JQuery attribute begins with selectors

I have a problem with the jQuery attribute starting with selectors [name^="value"]. below is what i am trying to do

var parentContainer = $('#myparent');
$.each(parentContainer.find('*[name^="a[2].b[0].c"]'), function(){
 alert('Hi');               
});

Although the parent Container has elements with a name starting with a[2].b[0].c, it still fails to warn "Hello."

But when I try to do it as below, it works

var parentContainer = $('#myparent');
$.each(parentContainer.find('*[name^="a[2].b"]'), function(){
 alert('Hi');               
});

need ur help thanks in advance

+3
source share
1 answer

Look at the answers to the question .

The following quote may show the cause of your problem:

ID NAME ([A-Za-z]), , ([0-9]), ( "-" ), ( "_" ), ( ":" ) ( "." ).

name ( id), , , .

Firefox ( 4), Safari 4 5, Chrome 12, IE8 IE9, fail (undefined ) IE6 IE7.

+6

All Articles