How can i add styling css for this elements? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i add styling css for this elements?

class Car{ constructor(name, doi, trei){ this.name=name; this.doi=doi; this.trei=trei; } } const myCar=new Car("Audi", "sds", "dssd"); document.write(myCar.name+"<br>"); document.write(myCar.doi+"<br>"); document.write(myCar.trei+"<br>"); document.write(myCar.name+"<br>"); document.write(myCar.name+"<br><br>"); for(i=1; i<9; i++){ document.write(myCar.name+"<br>"); }

27th Jan 2022, 4:03 PM
Paul Hoha
Paul Hoha - avatar
2 Answers
+ 1
Thanks for your response
27th Jan 2022, 5:53 PM
Paul Hoha
Paul Hoha - avatar
0
For simplicity, you can do as already doing document.write("<b>"+myCar.name+"</b><br>"); //bold style document.write("<p>"+myCar.doi+"</p>"); //pata graph here you can add inline css.. Or Create a tag, by document's createChild or append child methods and then you can add content and style by (obj).style={.. } Or by jquery's $("tag").css ( {"add styling here "} ) May be there better methods idk...
27th Jan 2022, 4:40 PM
Jayakrishna 🇮🇳