PlaceHolder in HTML

The placeholder attribute displayed text in the input or textarea field before the user enters a value. Placeholder is very useful when your requirement is show hint on input and when users enter some value then hint should be removed.

HTML5 has introduced many new features. The Placeholder is also new feature in HTML5 and it supported in all new browser.

You can also complete this work with the help of jquery or JavaScript but in this case you have to write dozed line of code.

<!DOCTYPE html>
  <title>jQuery With Example</title>
  <script src="" type="text/javascript"></script>
  <script type="text/javascript">
    $(function () {
      $('.btnGetName').click(function () {

  <div class="Container">
    <input type="text" class="txtName" placeholder="Enter Name" />
    <button type="button" class="btnGetName">Get Name</button>

No comments :

Please Give Your Feedback