I got an Javascript code like this:
divElement.appendChild(document.createTextNode("Optie " + inputNumber + ": "));
Now I would like to put "Optie " and ": " in h7 tags.
How can i do this?
I got an Javascript code like this:
divElement.appendChild(document.createTextNode("Optie " + inputNumber + ": "));
Now I would like to put "Optie " and ": " in h7 tags.
How can i do this?
Share Improve this question edited Oct 19, 2011 at 13:19 Augus asked Oct 19, 2011 at 13:12 AugusAugus 4931 gold badge8 silver badges25 bronze badges 6- @BalaR - I guess so, his title says Javascript – Duniyadnd Commented Oct 19, 2011 at 13:16
- Yea i do :) Sorry for the confusion :). – Augus Commented Oct 19, 2011 at 13:18
- h7 tags?! the range is from 1 to 5! – daveoncode Commented Oct 19, 2011 at 13:22
-
What are
h7
tags? You must be new to HTML. @daveoncode, tags range from1-6
– zzzzBov Commented Oct 19, 2011 at 13:22 - 1 ops! falled in the same error :P 1 to 6... anyway there is not h7 tag :P – daveoncode Commented Oct 19, 2011 at 13:26
2 Answers
Reset to default 5there is no "h7". Max is H6
Sorry, the right code:
newHeadline = document.createElement( 'h6' );
text = document.createTextNode("Optie " + "ddd"+ ": ")
divElement.appendChild( newHeadline.appendChild( text ) );
var myHeader = document.createElement("h5");
myHeader.innerHTML = "Optie " + inputNumber + ":";
myHeader; // => <h5>Optie 123:</h5>