I have the following code:
var l = $("input[name*=hello").length;
$('#result').text(l);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<input name="hello" type="text">
</div>
<div>
<input name="hello" type="text">
</div>
<div id="result">
</div>
Where the jQuery selector is:
input[name*=hello
Check that the selector is not correctly written input[name*=hello since a ] is missing.
On Chrome I get on the div[id=result] the amount of inputs that I have with the name "hello" (2).
But on Safari I get an error on the Console:
Which is correct, so the question is: Why did Chrome "autocorrect" the selector? Is it possible to remove that behaviour?
