-1

Hello guys i was wondering how would I edit this using JavaScript DOM?

<div class="player-column" style="width: 675.556px;"></div> 

I'd prefer a method using

document.querySelector(".player-column") 

(i want to edit the width of the style btw)

3
  • 2
    document.querySelector(".player-column").style Commented Feb 22, 2014 at 21:28
  • In what way do you wish to edit it? Change width? Change background colour? Change value of all items that are within it? More detail please... Commented Feb 22, 2014 at 21:29
  • i wish to change the width in the element :) Commented Feb 22, 2014 at 21:30

1 Answer 1

0

Quite simple:

document.querySelector(".player-column").setAttribute("style","width:900px"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.