So say that I want to get the script tag that is responsible for housing a current function, does anyone know how to do that? Let me put this into context so it makes a little more sense.
<select>Options here</select>
<script>
Some code that wants to mess with that select
</script>
If I can get that code inside of the select to know the node that contains it, I can then to .parent().find(‘select’).whatever inline before the element is rendered, this reducing the ‘flickering’ of transforming that select into a jSelect. I would also be able to do it fast enough so that using an inline script doesn’t make me hate myself.
So… does anyone know how to get the encapsulating script element of a current JS block?
get the encapsulating script element
Moderator: General Moderators
Re: get the encapsulating script element
You can't put <script> inside <select>, that's not valid. Add ID to the select and use it.