skip to Main Content

Why inputElement.maxLength returns -1? – Html

I wonder why default maxLength/minLength property for HTMLInputElement is set to -1 by default. There is also confusing behavior like below: Example <input type="text" /> const inputElement = document.querySelector('input'); console.log(inputElement.maxLength) // -1 I set maxLength programatically inputElement.maxLength = 2; console.log(inputElement.maxLength)…

VIEW QUESTION

jquery and sort function not working in chrome but works in firefox?

i use a javascript routine with jquery3.6.1 to order divs as follow when the button #tri is clicked: $("#tri").click(function() { var $divs = $("#resultats div.notice"); var alphabeticallyOrderedDivs = $divs.sort(function (a, b) { return $(a).find("div.bibloc:first").text() > $(b).find("div.bibloc:first").text(); }); $("#resultats").html(alphabeticallyOrderedDivs); }); the…

VIEW QUESTION
Back To Top
Search