javascript - Can I add a style tag to innerHTML? -
i'm trying post innerhtml table. font size in 1 cell bigger. possible include style tag so?
cell4.innerhtml = "<style: font-size:40px>" + "john doe" + "</style>" + "</br>"; i tried following fiddle, isn't working. http://jsfiddle.net/s1dj3x8e/
the <style> tag meant container css code inside head, you're trying accomplish cannot done element in context.
try replacing following line:
cell4.innerhtml = "<style: font-size:40px>" + "john doe" + "</style>" + "</br>"; with:
cell4.innerhtml = "<span style='font-size:40px'>john doe</span>"; updated fiddle (now span instead of div correctly pointed out zach below):
Comments
Post a Comment