Home > Web Front-end > HTML Tutorial > The value of the ie text box does not return to the default after refreshing_html/css_WEB-ITnose

The value of the ie text box does not return to the default after refreshing_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 12:08:57
Original
1713 people have browsed it








Refresh after entering a value in the text box in the IE message maker. The text box will not restore the default value of 1. Instead, it will be the value after input. value. Now I want this text box to return to its default value after refreshing.


Reply to the discussion (solution)

There is no problem in the test. . Which IE do you use?

It seems that it can only be achieved using js. . . . .

There is no problem with the test. . Which IE do you use?
I tried it. There is a problem. When you click refresh on ie, the value will not change. I use ie8

I have tried both ie6 and ie8. Refreshing is the entered value rather than restoring the default value!

Tried both ie6 and ie8. Refreshing is the entered value rather than restoring the default value!
Generally this is implemented using js. . . It’s very easy to implement with js

How to do it! I change the value of the text box in js. Opening the webpage works, but refreshing the webpage does not change the value of the text box

Quoting the reply from zsx841021 on the 1st floor:

There is no problem in the test. . What IE do you use?

I tried it. There is a problem. When you click refresh on IE, the value will not change. I am using IE8
IE9 and there is no problem. .

How to do it! I change the value of the text box in js. Opening the webpage works, but refreshing the webpage does not change the value of the text box

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script type="text/javascript">	function loadding()	{		document.getElementById("input1").value="1";		}</script></head><body onload="loadding()">	<input id="input1" type="text" value="1" /></body></html>
Copy after login

How to do it! I change the value of the text box in js. Opening the webpage works, but refreshing the webpage does not change the value of the text box

I debugged it in IE8 and it is no problem. Achievable


transitional.dtd">



Untitled Document








Thank you wangyao1135 I didn’t write it in the onload event. So the refresh doesn't work. Haha


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body >  <input id="input1" type="text" value="6" /><script type="text/javascript">     document.getElementById("input1").value="1";    </script></body></html>
Copy after login


transitional.dtd">


HTML code

transitional.dtd">

I am testing!

That’s it. . .

For local files, you can press ctrl F5 to force a refresh, which should solve your problem.

But on my IE9, CTRL F5 does not work. On FF CTRL F5 is OK.

If you press F5, as the poster said,

Use js to trigger the reset event of the form after the page is loaded or set the initial value individually for each

Use js in Trigger the reset event of the form after the page loads or set the initial value of each individually

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template