passing parameter to js snippet

0
Hi there, I have a HTML snippet, inside a list view. The list view contains two lines of addresses. When edit button is clicked, fields become editable else they are read-only. In edit mode, I want to add a red asterisk to the first heading i.e. first address line. I'm able to add asterisk to the heading with jquery in HTML snippet, but it is being called twice. I'm checking if address line 1 exist. Since, condition is true and list has two elements, two asterisk are getting appended to the heading. I want to check if function is being called only on first element of list. Is there a way to pass list view element to the jquery?
asked
1 answers
2

Why can't you solve this by simple JavaScript code? For instance add in your code a check if asterix is already there and if not so, append, if already there, do not append? 

answered