{"id":11295499,"date":"2019-03-10T13:20:09","date_gmt":"2019-03-10T13:20:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/adding-close-action-by-javascript\/"},"modified":"2019-03-10T13:20:09","modified_gmt":"2019-03-10T13:20:09","slug":"adding-close-action-by-javascript","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/adding-close-action-by-javascript\/","title":{"rendered":"Adding close action by javascript"},"content":{"rendered":"<p>I added the following javascript in the content to add a close action when a button is clicked but it doesn&#8217;t work.  Do you know why?<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\njQuery(function() {<br \/>\n  jQuery(&#8216;.hs-submit .hs-button&#8217;).click(function(e) {<br \/>\n    e.preventDefault();<br \/>\n    jQuery(&#8216;.spu-close&#8217;).trigger(&#8216;click&#8217;);<br \/>\n    return false;<br \/>\n  });<br \/>\n});<br \/>\n&lt;\/script&gt;<\/p>\n","protected":false},"template":"","class_list":["post-11295499","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11295499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/11295499\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=11295499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}