Javascript and css | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Javascript and css

How can i give an java text,command.. an id to edit in css like in html id="..."?

23rd May 2017, 9:56 AM
TrueJu
TrueJu - avatar
9 Answers
+ 9
Java or Javascript? You can access to id elements with the following syntax: document.getElementById("yourid");
23rd May 2017, 10:00 AM
Maz
Maz - avatar
+ 4
...I understood your question like "How to edit id for css rule"... https://code.sololearn.com/WZYJD2iD7lh4/?ref=app I understood like that =_=
23rd May 2017, 10:19 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 4
Umm...@_@ I didn't understand with that question srry
23rd May 2017, 10:28 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 2
javascript
23rd May 2017, 10:01 AM
TrueJu
TrueJu - avatar
+ 1
In HTML: <div id="example">This Text</div> In CSS: #example{ color: red; } Changing the color is only one example
23rd May 2017, 10:02 AM
Maart
Maart - avatar
+ 1
i already know how to do it in html but thank you ;D
23rd May 2017, 10:03 AM
TrueJu
TrueJu - avatar
+ 1
thank you
23rd May 2017, 10:15 AM
TrueJu
TrueJu - avatar
+ 1
no, but i found out what i wanted to know thank you for your answer and help :D i have a new question.. so if you can help it would be great :D
23rd May 2017, 10:22 AM
TrueJu
TrueJu - avatar
+ 1
$_$ no problem:D
23rd May 2017, 10:29 AM
TrueJu
TrueJu - avatar