jQuery val function

It is a sample code for using jquery val() function.
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width,user-scalable=no"/>
    <script type="text/javascript" src="./js/jquery-1.9.1.js"></script>   
</head>
<body>
	<p>Name: <input type="text" name="user" value="Hello Tizen" /></p>
	<button>Change the text field</button>
<script> 
	$("button").click(function(){
	    $(":text").val("jquery mobile");
	});
</script>
</body>
</html>

Responses

0 Replies