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
Post a Comment