Learn free online HTML5, javascript, and jquery Tutorials by Examples

Monday 2 June 2014

Dynamically change "title" using jQuery

------------------------------------------
<script src="http://http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 
<script>
    $(document).ready(function(){
      $('#click-me').click(function(){
        document.title = $(this).val();
      });

-------------------Another Way-------------------------

document.title = 'new title';

    });
</script>

<input type="button" id="click-me" name="clickme" value="Click me!" />

-----------------------------------------

No comments:

Post a Comment