Javascript Function Will Not Activate Onclick
In my page head: In my page body:
Solution 1:
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();
}
You may like these posts
- Deleting A Directory When Clicked On A Hyperlink With Javascript.asp.net C#
- Changing An Image While Click Is Held
- Jquery: Is Element.click(func) Or Element.attr('onclick','func()') More Efficient?
- How Do I Close A Modal Dialog When A Link (internal Or External) Is Selected And How Do I Set One Or More Exceptions?
Post a Comment for "Javascript Function Will Not Activate Onclick"