0

I have a question how will I make this code as one line.

document.getElementById("messageBodyView").style["background-color"] = "#ffffff";
document.getElementById("messageBodyView").style["border"] = "none";

I mean to make it shorter. Thank you very much for any help.

m4n0
  • 29,823
  • 27
  • 76
  • 89
QWERTY
  • 263
  • 2
  • 6
  • 21
  • Wrap desired functionality in a function and call it? Not sure what else you could do here - the native DOM API doesn't lend itself to fluent calls if that's what you're going for – jdphenix Jul 23 '15 at 02:48
  • may be create css class with those styles and add the class with js…! – Sudhir Bastakoti Jul 23 '15 at 02:48
  • Relevant reference: [w3c Dynamic style - manipulating CSS with JavaScript](http://www.w3.org/wiki/Dynamic_style_-_manipulating_CSS_with_JavaScript) – aug Jul 23 '15 at 02:49

0 Answers0