Javascript Function Will Not Activate Onclick
In my page head: In my page body:
It's not working because your function is erroneous:
functionformula() {
document.getElementById(document.forms.inquire.search.value).scrollIntoView();
}
That code gets the value of the search field and uses it for an "id" lookup. It'd probably be a good idea to check that there actually is an "id" with the value typed in:
functionformula() {
var element = document.getElementById(document.forms.inquire.search.value);
if (element) element.scrollIntoView();
}
Post a Comment for "Javascript Function Will Not Activate Onclick"