jeudi 16 juin 2016

How to change the title of page after input field is filled


I want to change the title of page after user has filled the title input field in the form like stack overflow does!

here is the html code

<input type="text" id="titl" name="title" onkeyup="myFunction()" value="">

javascript function

function myFunction() {
    document.title = $("#titl").val();
}

How can i achieve this?


Aucun commentaire:

Enregistrer un commentaire