JQuery Programming, For Beginners, Learn Coding Fast! by Yao Ray

JQuery Programming, For Beginners, Learn Coding Fast! by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: JQuery Programming, For Beginners, Learn Coding Fast!
Published: 2020-03-18T16:00:00+00:00


Original:

Output:

Explanation:

“$("#divContent"). width()” accesses the “#divContent” tag, and get its width( ).

height( )

The height() function is used to get the height of an element.

Example 4.6

<html>

<head>

<script src="jquery-1. 11. 3. js"></script>

<script type="text/JavaScript">

function getHeight() {

alert("The height for the div is " + $("#divContent").height() + "px.");

}

</script>

</head>

<body>

<input onclick="getHeight()" type="button" value="Get Height" style="color: red;" />

<div id="divContent" style="width: 200px; height: 60px; ">

Hello World

</div>

</body>

</html>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.