If IE tag doesn't work for IE11

I got a script for a quantity field where you can add or remove items.

However, it doesn't work in IE, probably because there is a button inside the anchor tag, what I wanted to do was use the onClick function to be used when the user is using IE.

This would do it, I thought, but I found out that it doesn't work like IE11.

Does anyone know a workaround? I only want to use the onClick function when using IE as the quantity field works fine in other browsers.

<!--[if lt IE 11]>
<![endif]-->

      

If this helps anyone, this is the code I'm talking about that doesn't work in IE.

<a href="?del='.$key.'" class="minus" >
    <input type="button" class="minus" value="-" id="min">
</a>

<input type="text" class="input-text qty text" title="Qty" value="'.$value.'" name="quantity" min="1" step="1">

<a href="?add='.$key.'" type="button" class="plus">
    <input  type="button" class="plus" value="+">
</a>

      

+3


source to share


2 answers


Conditional comments are no longer supported as of IE 10 .

You can use a meta tag to make IE render the page in IE9 mode:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

      

Then the conditionals must work again.



Please take a look at the article I linked to for more details.


The big problem, however, is that you are wrapping your inputs in tags <a>

. This is invalid syntax, and most likely the reason the page is misbehaving.

+9


source


Internet Explorer 10 and 11 DO NOT support conditional if

comments. They are only supported since IE9.

You can read more about them in this post on MSDN .

Dropping support is covered in this article from the MSDN site itself .

On the same page:



If the page works correctly in other browsers, consider using the discovery feature of Internet Explorer 10 just like other browsers. Otherwise, add the following meta tag at the top of the page to select the behavior of Internet Explorer 9: HTML

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

This workaround should be avoided. Save your semantic code and in most cases you won't need it.

In your case, don't wrap elements input

in anchor / any other tags. Use instead label

.

+5


source







All Articles