Well, I am storing variables inside of a class that will be used for other elements. Might not be the best approach for this, but is easier to do when I grab the element using $("tr").each(function{ // code }); Perhaps there is a better attribute to store these variables in?? Or a better overall way of doing it?
But basically, I am trying to use the markRow: text as a beginning string to the variable that I need to determine if this tr element has within it’s class. If it has the text “markRow:”, I than need to split(":"), only this class (because the tr elements can have more than 1 class defined on them), into an array and only grab the 2nd array bound. Than, after I use these variables, I need to wipe out all classes from each tr element that has markRow: defined within the class, but don’t want to remove any other classes that these tr elements might have within them when doing this.
Can someone please get me started on this? Was thinking of the selector :contains for a partial match for the markRow: string, but not sure if this is any good. Perhaps using filter somehow might help?
Based on my understanding of your problem here is what you can try.
Keeping your problem aside I would suggest you to use data attributes to pass on data along with element on the page. It becomes very easy to retrieve data from data attributes.
E.g.
To get
data-infoattribute value fromdiv1element you can use the below code.To set
data-infoyou can use this code.data()reference: http://api.jquery.com/jQuery.data/