0

I need the text box change event in the case when the browser automatically updates the username the password will automatically gets updated in the password field .At that time the watermark should hide .So that time the i need to call text box change event.I tried with following events onfocus focusout onblur change keyup keypress keydown

selva
  • 184
  • 2
  • 3
  • 16

1 Answers1

0

Example for Textbox change event

Syntax

$(selector).change(function)

e.g.

$(“txtbox”).change(function)

Like this

    <html>

<head>

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>

<script>

$(document).ready(function(){

    $("#txtchange").change(function(){

        alert ("change event occured with value: " + document.getElementById("txtchange").value);

  });

});

</script>

</head>

<body>

<p>Enter some text in first field then either press Tab key or click somewhere else on page!</p>

<form id="changeform">

Enter text: <input id="txtchange" value="" type="text">

text field 2: <input id="txtchange2" type="text">

<input type="submit" value="submit now"/>

</form>

</body>

</html>
Nagaraj S
  • 13,316
  • 6
  • 32
  • 53