I have a UserControl in MVC that can repeat many times on a page.
Say I had something like the following:
<div>
<a href="#" class="enableTextBox">edit</a>"
<input type="text" class="comments" readonly="readonly" />
</div>
<div>
<a href="#" class="enableTextBox">edit</a>"
<input type="text" class="comments" readonly="readonly" />
</div>
<div>
<a href="#" class="enableTextBox">edit</a>"
<input type="text" class="comments" readonly="readonly" />
</div>
How can I find an element class="comments"that is in the same div as a link class="enableTextBox"in the onclick event of the link?
Is this a smart way to handle element identifier conflicts? Is there a better way? How safe is it in terms of working in a corporate application and be sure of data consistency?
source
share