First, the size of jquery
JQuery offers several important ways to handle dimensions:
Width () Sets or returns the length of the element (excluding padding, borders, or margins), the value width parameter is filled in parentheses, no units
Height () Sets or returns the altitude of the element (excluding padding, borders, or margins), which can be filled in parentheses with a numeric height parameter, without units
Innerwidth () returns the width of the element (including the padding)
Innerheight () Returns the height of the element (including the padding)
Outerwidth () returns the width of the element (including padding and borders)
Outerheight () Returns the height of the element (including padding and borders)
Outerwidth (True) returns the width of the element (including padding, borders, and margins)
Outerheight (True) returns the height of the element (including padding, borders, and margins)
you can also get width of HTML document and browser window:
$ (window). Width ()// Gets the widths of the current browser window
$ (window). Height ()// Gets the altitude of the current browser window
$ (document). Width ()// gets the width of the HTML document (body)
$ (document). Height ()// gets the altitude of the HTML document (body)
Ii. how jquery is set up and acquired
text ()- Sets or returns the text content of the selected element
HTML ()- Sets or returns the contents of the selected element (including HTML tags)
Val ()- Sets or returns The value of form value
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0"> <Metahttp-equiv= "X-ua-compatible"content= "Ie=edge"> <title>Document</title></Head><Body> <inputtype= "text"value= "Please enter content"/> <Div><ahref="##">Dot me!</a></Div></Body></HTML><Scriptsrc= "Js/jquery-1.12.4.min.js"></Script><Scripttype= "Text/javascript"> $('input'). Val ('the content has been modified'); //set the value of the form's Values propertyConsole.log ($ ('input'). Val ()); //get the value of a form's property $('Div'). HTML ('<a href= "# #" > Click on me!!!! </a>'); //set the contents of a div tagConsole.log ($ ('Div'). HTML ()); //get the contents of a div tag $('Div'). Text ('<a href= "# #" > Click on me!!!! </a>'); //set the text content of a div tagConsole.log ($ ('Div'). text ()); //get the text content of a div tag</Script>
Second,
JQuery set up and get content methods
jquery size and jquery settings and get content methods