Why doesn't this simple JQuery selector work in IOS? -


i have simple html:

<div id="mydiv">     <a href="#" id="myid-test">click here</a> </div> 

and jquery click handler:

$('#mydiv > a').on("click", function (e) {     try {         var count = $('[id^="myid-"').length;         alert('count is: ' + count);     }     catch(error) {         alert('error: ' + error)     } }); 

so it's supposed alert "count is: 1", fine on windows desktop browser in chrome browser.

but on ios alerts error: error: syntax error, unrecognized expression: [id^="myid-". have tested in both chrome , safari app browsers on iphone 5s , ipad mini 3. both have ios 8.3 installed.

here fiddle.

why doesn't jquery expression work in ios?

i think missed ']'. should this

var count = $('[id^="myid-"]').length; 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -