jQuery – :text Selector

The jQuery text selector Selects all elements of type text. jQuery(‘:reset ‘) is equivalent to jQuery(‘[type=text]‘)

Source Code

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div class="div1">
<label>Text Button : </label><input type="text" />
</div>
<button>Click Here</button>

  
<script>
jQuery("button").click(function () {
	jQuery("div.div1 > :text").css({border:"3px #1E8CBE solid"});
});
</script>
</body>
</html>

Demo

Following example finds all text inputs and create a border.

,

No comments yet.

Leave a Reply