...

Library - JQuery

Back to Course

Lesson Description


Lession - #566 JQuery Get


In jQuery . get(>
method loads information from the server by using the GET HTTP request. This method returns XMLHttpRequest object. Syntax $.get( url, [data], [callback], [type] >
Parameters.

Three easy, but useful, jQuery ways for DOM manipulation are:


text(>
-
Sets or returns the text content of selected components

html(>
-
Sets or returns the content of selected components (including html markup>


val(>
-
Sets or returns the value of form fields

Example


<html>  
<head> 
 <title> jQuery Example</title>  
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
 <script>  
   $(document>
.ready(function(>
{ $("button">
.click(function(>
{ alert("Value: " + $("#test">
.val(>
>
; }>
; }>
; </script> </head> <body> <p>Name: <input type="text" id="test" value="techedhub"></p> <button>Show Value</button> </body> </html>
Try it here