I have a webpage with a div which contains several other divs WITHOUT an ID associated to them:
<div id="container">
<div title ="jhon" style=" position:absolute; left: 821px; top: 778.44px; width:8px; height:9px; z-index:3;"> </div>
<div title ="carl" style=" position:absolute; left: 561px; top: 579.88px; width:8px; height:9px; z-index:3;"> </div>
</div>
I need to be able to search one of these div by title and then access its style attributes such as left and top.
I am using jQuery but I have no idea on how to select an element by name. I've tried something like:
var c =$('div[title~="john"]');
alert(c); //I get [object Object]
alert(c.style.left) // throws an error and is undefined
but it seems not to work.
Any help?