I currently have a textbox in my aspx:
I was wondering if I could set the focus
Try this:
function setFocus(id) {
document.getElementById(id).focus();
}
In this way, your function becomes reusable. Just pass the ID of the html element to be given the focus when you call the function.
M.
Invoke the lowercase .focus()
function:
function setFocus() {
document.getElementById("myTextbox").focus();
}