Unexpected behavior from Internet Explorer - Span contents remain unchanged despite valid input

I have a simple question because I'm feeling a bit lost.

Check out this JSFiddle link

It seems that in Internet Explorer, the contents of my span won't update even though the input is valid. However, in other browsers, the span content changes successfully.

If anyone could take a look at the fiddle and help me out, I would be really thankful.

HTML

<form action="javascript:void(0);" id="formId1" name="validateForm1">
  <table class="inputTables" id="create_trck_table1">
    <thead>
      <tr>
        <th>Attribute</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>ID</td>
        <td><input id="id1" maxlength="9" title="e.g AMS30-E3" type="text" required>&nbsp;&nbsp;<span></span></td>
      </tr>
    </tbody>
  </table>
</form>

<p id="myP">
</p>

CSS

input[type="text"]:invalid+span::after {
  color: red;
  content: "X";
}

input[type="text"]:valid+span::after {
  content: "\2713";
  color: limegreen;
}

Javascript (Jquery)

$(':input').on('keydown', function() {
  var valid = $('#id1').is(':valid');
  $('#myP').html('The Input is ' + valid);
})

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

My code is experiencing issues with JQuery's $.post, $.get, and $.ajax functions not functioning properly

Struggling to post and retrieve data from a php file using JQuery? Feel like you've tried everything from post to get and $.ajax method but still no luck? The php code doesn't seem to be getting called? Take a look at myUpload.php file which suc ...

Experiment with jQuery and JavaScript compatibility specifically on Internet Explorer 6

Seeking advice on the most effective method to test my web app using IE6. I currently have IE8 installed on my computer, and am considering utilizing a Virtual Machine. Are there any other alternatives worth exploring? It is imperative that my jQuery and ...

Filtering in AngularJS can be performed by checking if a value in a specific key of one array is also present as a value in a specific

This query was originally posted on this thread I am looking to implement a filter that will display the values of colors.name only if they also exist in cars.color $scope.colors = [{"name":"blue","count":2}, {"name":"red","count":12}, ...

Tips for substituting @media (max-width) with Stylish or Greasemonkey?

I am encountering an issue when trying to access this specific website on my desktop browser. The site has a responsive/fluid design that switches to displaying a mobile menu button instead of a horizontal nav-bar when the browser width is less than 990px. ...

Learn how to use JQuery to read and print JSON data using the $.getJSON

I am diving into a new territory, so please bear with me. As someone who has used json and serialize extensively in PHP, I am now exploring JQuery. My aim is to pass data across domains, and using a json array seems like the best approach. However, I am un ...

Is it possible to use an ngClick function in one directive to toggle data in another?

Currently, I am in the process of developing a weather application using Angular 1.5.8 where users should have the option to switch between imperial and metric units for temperature and wind speed. The toggle feature along with all the weather data fetche ...

Sending multiple parameters using Jquery

for (let i = 0; i < data.length; i++){ $("#menu").append("<button onclick='selectMeal("+data[i]['id']+", "+data[i]['name']+")'>Select</button>") } function selectMeal(id, name){ //perform some action } ...

Issue with jQuery.off when using a dynamic function name

I am currently implementing a modular pattern for writing my JavaScript code and it has been an enjoyable experience! However, I have encountered a challenging situation. My Namespace structure looks like this: var settings, handlers, objects, Namespace ...

What is the simplest method for transferring data to and from a JavaScript server?

I am looking for the most efficient way to exchange small amounts of data (specifically just 1 variable) between an HTML client page and a JavaScript server. Can you suggest a script that I can integrate into my client to facilitate sending and receiving d ...

How to deactivate the <a> tag with Ant Design UI Library

Is there a method in the antd UI library to disable a link? The disabled attribute is not supported by the a tag according to MDN. This code snippet works in React but the link remains clickable when using Next.js. <Tooltip title={tooltip}> <a ...

Problem with Bootstrap loading state when certain input fields are required

Just starting out with Bootstrap 3 and looking to integrate the loading state button function into my form. I've set up an input field with the required option as shown below. <form> <input class="input" name="title" type="text" required / ...

Improve the performance of my website and resolve the zooming problem

Trying my hand at teaching myself jquery and creating a decent layout. I believe what I have done is acceptable, but I still have some questions. This is my first attempt at jquery without copying someone else's work. I've aimed to keep it relev ...

Sometimes the Navbar options fail to show up consistently on the Navbar bar

I recently launched my website at campusconnect.cc Unfortunately, I've noticed that when resizing the window, the navbar options are shifting up and down. Can anyone help me identify the issue and provide guidance on how to resolve it? ...

How to send parameters to Bootstrap modal using a hyperlink

I need help confirming the deletion of a datatable row using a Bootstrap modal dialog. When a user clicks on the delete link, I want a modal to appear asking for confirmation. Here is my code: <c:forEach items="${equipes}" var="equ"> ...

Assign a temporary value to the Select component in Material UI version 1.0.0-beta.24

I am currently working on a test project using Material UI v1.0.0-beta.24, and I have noticed that the "Dropdown" menus behave differently compared to the previous version. What I am trying to achieve is setting up a placeholder in the Select component. P ...

choosing a specific element within an HTML string stored in a variable

I have a variable containing HTML string data like this: var htmlstring = "<div><div class='testdiv'>924422</div></div>" My goal is to extract the content of the div with a specific class, in this case .testdiv. How ca ...

When utilizing PHP Form Validation alongside Javascript, the validation process does not halt even if a

I have been grappling with creating a basic HTML form validation using Javascript After experimenting with various examples, I am still facing the issue of my index page loading upon clicking the button on the form. Despite including "return false" in wha ...

Assistance needed with CSS floating properties

Despite seeing many inquiries about float, I still can't pinpoint what's causing my issue. My objective is simple: GREETINGS FRIEND I aim for it to align just to the left of the unordered list. Referencing this solution, I attempted adding cl ...

Safari displays the contents of JSON files instead of automatically downloading them

I am facing an issue with a JavaScript code that generates a link to download a JSON file. The link is structured like this: <a href="data:text/json;charset=utf-8,..." download="foo.json">download</a> While the link works perfectly in Chrome ...

Invoking Angular component method using vanilla JavaScript

For my web application, I am utilizing Angular and require Bluetooth functionality on a specific page. I am implementing loginov-rocks/bluetooth-terminal (https://github.com/loginov-rocks/bluetooth-terminal) for establishing the Bluetooth connection, which ...