HTML DOM Marquee height Property
The HTML DOM Marquee height Property is used to set or return the value of the height attribute of the <marquee> element.
Syntax:
It returns the marquee height property.
marqueeObject.height
It sets the marquee height property.
marqueeObject.height="px/%"
Note: This property is depreciated from HTML 5.
Property Values:
- px: It defines the height value of the marquee.
- %: It defines the height value of the marquee.
Return Value : It returns a numeric value that represent the height of the <marquee> element in terms of pixel
Example 1: Below HTML code returns the marquee height property.
HTML
<!DOCTYPE html> < html > < body style = "text-align:center;" > < h1 style = "color:green;" > w3wiki </ h1 > < h2 >DOM Marquee height Property</ h2 > < marquee id = "marqueeID" direction = "right" behavior = "slide" loop = "3" bgcolor = "green" height = "40px" > w3wiki:A computer Science Portal for Beginner </ marquee > < br >< br > < button onclick = "btnClick()" > Return height of Marquee Tag </ button > < p id = "sudo" ></ p > < script > function btnClick() { var txt = document.getElementById( "marqueeID").height; document.getElementById( "sudo").innerHTML = txt; } </ script > </ body > </ html > |
Output:
Example 2: Below HTML code sets the marquee height property.
HTML
<!DOCTYPE html> < html > < body style = "text-align:center;" > < h1 style = "color:green;" > w3wiki </ h1 > < h2 >DOM Marquee height Property</ h2 > < marquee id = "marqueeID" direction = "right" behavior = "slide" loop = "3" bgcolor = "green" height = "40px" > w3wiki:A computer Science Portal for Beginner </ marquee > < br >< br > < button onclick = "btnClick()" > Change height of Marquee Tag </ button > < p id = "sudo" ></ p > < script > function btnClick() { var txt = document.getElementById( "marqueeID").height = "20px"; document.getElementById( "sudo").innerHTML = txt; } </ script > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Apple Safari
- Opera