temp = $.jstree._focused().get_selected().html()
Gave me a block of html. There is a button inside of that html:
<button class="square_button button_background" type="button" onclick="run_through_ajax('login','basics')">
run
</button>
How can I search ONLY inside temp variable and get the value of onclick?
I am asking jQuery code that searches inside temp variable for button and gives me onclick.
Note that temp is not equal only <button class="square_button button_background" type="button" onclick="run_through_ajax('login','basics')">
Instead of getting the actual HTML, search within
$.jstree._focused().get_selected()usingfind().e.g.
$.jstree._focused().get_selected().find('button').first().attr('onclick')Does that work?