Prev Demo
jQuery
>
.Width() - Get & Set Width Of Element
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <h1>This is H1</h1> <h2>This is H2</h2> <script> $("h1").css("background", "#c0c0c0").width("200px"); </script> <h1 style="color:pink">The width of the H1 is.....in dialogue box.<h1> <script> alert($("h1").width()); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output