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>"); }
2 Answers
+ 1
Thanks for your response
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...