{"id":198,"date":"2019-10-24T21:39:48","date_gmt":"2019-10-25T00:39:48","guid":{"rendered":"http:\/\/fabiobrandao.net.br\/blog\/?p=198"},"modified":"2023-03-12T00:11:35","modified_gmt":"2023-03-12T03:11:35","slug":"jquery-acionar-botao","status":"publish","type":"post","link":"https:\/\/fabiobrandao.net.br\/blog\/javascript-e-bivliotecas\/jquery-acionar-botao\/","title":{"rendered":"jQuery &#8211; Acionar bot\u00e3o"},"content":{"rendered":"<p>Esta dica \u00e9 bem simples e trata-se de acionar um bot\u00e3o usando\u00a0<strong>jQuery<\/strong>. Pode ser que voc\u00ea tenha um conjunto de procedimentos executados encapsulados e executados no acionamento de um bot\u00e3o. Voc\u00ea tem a op\u00e7\u00e3o de replicar o c\u00f3digo, ou desmembrar o c\u00f3digos em uma ou mais fun\u00e7\u00f5es que ser\u00e3o chamadas pelo bot\u00e3o. Outra alternativa \u00e9 simplesmente fazer o acionamento do bot\u00e3o de forma program\u00e1tica.<\/p>\n<p>Voc\u00ea pode fazer isso com o seguinte c\u00f3digo caso o seu bot\u00e3o tenha um id definido:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">$('#buttonId').click();<\/pre>\n<p>Se o seu bot\u00e3o utiliza uma classe fa\u00e7a o seguinte c\u00f3digo:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">$('.buttonClassName').click();<\/pre>\n<p>\u00c9 s\u00f3 isso mesmo! \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Esta dica \u00e9 bem simples e trata-se de acionar um bot\u00e3o usando\u00a0jQuery. Pode ser que voc\u00ea tenha um conjunto de procedimentos executados encapsulados e executados no acionamento de um bot\u00e3o&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":377,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[69],"tags":[34,33,9],"class_list":["post-198","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript-e-bivliotecas","tag-acionar","tag-botao","tag-jquery"],"_links":{"self":[{"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/comments?post=198"}],"version-history":[{"count":5,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":380,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/posts\/198\/revisions\/380"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/media\/377"}],"wp:attachment":[{"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabiobrandao.net.br\/blog\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}