Is it possible that when I check a checkbox it redirects me directly to a textbox ? Like if I did a TAB when I check it.
And if possible only with HTML and CSS
You can't do it with just HTML & CSS
but here is a solution using javascript:
window.onload = function() {
var checkbox = document.getElementById("agree"),
textbox = document.getElementById("textbox");
checkbox.onclick = function() {
if(this.checked) {
textbox.focus();
}
};
};
Maybe the minimal implementation would be:
<form name="f1">
<input id="in1" name="in1" type="checkbox" onClick="if(this.checked) document.f1.in2.focus()" /> Check option <br/>
<input id="in2" name="in2" type="text" />
</form>
The simpliest way is to use TabIndex attribut in the input element
<input type="checkbox" Tabindex="1"> </input>
<br>
<br>
<input type="text" Tabindex="2"> </input>
I hope this might help you
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.