javascript - How can i get refresh time from html input box and refresh it with that parameter? -


i want use auto refresh page in html code,i use html code:

<meta http-equiv="refresh" content="5" > 


every thing ok,but want user enter number html input box:

<input type="text" ><br> 


, refresh time time set enter number,for more explain,user enter 10 , page refresh every 10 second.how can solve that?thanks.

this untested.

to meta tags

var metatags = document.getelementsbytagname("meta"); 

to loop on them find right one

for (var = 0; < metatags.length; i++) {   if (metatags[i].getattribute("http-equiv") === "refresh") {   } } 

and change refresh interval (inside if)

metatags[i].setattribute("content", yourvalue); 

hope works.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -