Reputation: 35194
I have a radio button in my html:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<input type="radio" name="r"/>
</body>
</html>
If I check it, and reload the page (Firefox 20.0.1) it will stay checked. But if I clear the cache (ctrl+f5) the button gets unchecked again.
Is there any way to make it consistent so that it always unchecks itself when the page is refreshed? Or do I need to involve javascript? I've tried with and without the name
property.
PS. I wasn't able to make a fiddle. Try it on a local file in order to reproduce it.
Upvotes: 1
Views: 5751
Reputation: 3200
You can set autocomplete="off"
:
<input type="radio" name="r" autocomplete="off" />
Please check this documentations:
And working example: http://fiddle.jshell.net/2fAuY/2/show/ (thank you @ValarDohaeris for fiddle)
Upvotes: 7