0

HTML button works for other browser but it does not work for internet explorer.

<input id="submit1" type="button" value="Add" />
7
  • Do you mean the HTML doesn't create the button you'd expect? Which version of IE are you running?
    – moe
    Commented Dec 7, 2015 at 10:59
  • It does not call the function, I am using IE-11, I have written JQuery function, in chrome it works fine but it does not work for explorer
    – KumarV
    Commented Dec 7, 2015 at 11:00
  • Are you trying to use it as a submit-button? Would it be preferred to use the input as type="submit"?
    – moe
    Commented Dec 7, 2015 at 11:02
  • Its not a submit button
    – KumarV
    Commented Dec 7, 2015 at 11:04
  • Have you confirmed the jQuery is IE-compatible? There doesn't seem to be problems with the HTML
    – moe
    Commented Dec 7, 2015 at 11:05

1 Answer 1

2

Given the only code you provide:

<input id="submit1" type="button" value="Add" />

You can click this button but there is no action assigned to it.

Any clicks will propagate up the DOM and trigger other click events.

http://javascript.info/tutorial/bubbling-and-capturing

Update 1 - But you problem is probably how you use jQuery

6
  • Its something like dis...<script type="text/javascript"> $(document).ready(function () { $('#submit1').click(function(){ }); </script>
    – KumarV
    Commented Dec 7, 2015 at 11:26
  • Is the jQuery loaded properly before the page loads? You could confirm this e.g. by changing the click action to something like jQuery-type of alert text box and see whether the alert pops up
    – moe
    Commented Dec 7, 2015 at 11:32
  • $('#submit1').click(function(){console.log("click fired"); }); paste this the console of IE and then click on the button. let us know @vikashkumar Commented Dec 7, 2015 at 11:48
  • jQuery's ready function can conflict with SharePoint. Use proper SharePoint code: spcaf.com/blog/sp-context-dev-part-6-jquery-vs-sharepoint Commented Dec 7, 2015 at 12:02
  • @AtishDipongkor, On Clicking the button, function is called..
    – KumarV
    Commented Dec 7, 2015 at 12:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.