Inject button class type or ID into jquery

Daniel Tam March 10, 2022

How can I inject the button class or ID into jQuery?  Example below, button class $abcde.  I'd like to use that for jQuery($abcde).click(function(){

 

<button class=$abcde type="submit"  value=$paramLabel>$paramButtonCaption</button>


<script>
AJS.toInit(function ($) {
jQuery($abcde).click(function(){
jQuery.post(contextPath+"/json/removelabelactivity.action", {"entityIdString": "$content.id", "labelIdString": jQuery(this).val(), "atl_token": jQuery("#atlassian-token").attr("content") } ,function(){
window.location.reload();
});
});
});
</script>

1 answer

1 accepted

0 votes
Answer accepted
Daniel Tam March 11, 2022

figured it out, jQuery("." + "$abcde").click

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events