using your example:
<input name="ctl00$ContentPlaceHolder1$myTextBox"
type="text" id="ctl00_ContentPlaceHolder1_myTextBox" />
I use this to find the items i need.
$("input[id*='myTextBox']").
from Jquery.com "Matches elements that have the specified attribute and it contains a certain value."
docs.jquery.com/.../attributeContains
This way i don't have to inject server code. Also i can keep my javascript in a seperate js file with out dirtying up the design HTML code. Also I don't have to ad any attributes that aren't standard.
转载于:https://www.cnblogs.com/shiningrise/archive/2009/09/17/1568806.html