{"id":11771,"date":"2022-08-21T08:01:22","date_gmt":"2022-08-21T08:01:22","guid":{"rendered":"https:\/\/www.webhozz.com\/blog\/?p=11771"},"modified":"2023-05-19T08:21:56","modified_gmt":"2023-05-19T08:21:56","slug":"jquery-chaining","status":"publish","type":"post","link":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/","title":{"rendered":"jQuery : Chaining"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\">Metode Chaining<\/h5>\n\n\n\n<p>JQuery menyediakan fitur kuat lain yang disebut metode chaining yang memungkinkan kita untuk melakukan beberapa tindakan pada set elemen yang sama, semua dalam satu baris kode.<\/p>\n\n\n\n<p>Ini dimungkinkan karena sebagian besar metode jQuery mengembalikan objek jQuery yang selanjutnya dapat digunakan untuk memanggil metode lain. Berikut contohnya.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n&lt;script type=&quot;text\/javascript&quot;&gt;\n$(document).ready(function(){\n    $(&quot;button&quot;).click(function(){\n        $(&quot;p&quot;).animate({width: &quot;100%&quot;}).animate({fontSize: &quot;46px&quot;}).animate({borderWidth: 30});\n    });\n});  \n&lt;\/script&gt;\n<\/pre><\/div>\n\n\n<p>Contoh di atas menunjukkan metode chaining three&nbsp;<strong><em>animate()<\/em><\/strong>. Ketika seorang pengguna mengklik tombol pemicu, hal itu akan memperluas&nbsp;<strong><em>&lt;p&gt;<\/em><\/strong>&nbsp;ke 100% width. Setelah perubahan&nbsp;<em>width<\/em>&nbsp;selesai,&nbsp;<em>font-size<\/em>&nbsp;mulai dianimasikan dan setelah selesai, border animation akan dimulai.<\/p>\n\n\n\n<p>Kalian juga dapat memecah satu baris kode menjadi beberapa baris agar lebih mudah dibaca. Misalnya, urutan metode dalam contoh di atas juga dapat ditulis sebagai:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n&lt;script type=&quot;text\/javascript&quot;&gt;\n$(document).ready(function(){\n    $(&quot;button&quot;).click(function(){\n        $(&quot;p&quot;)\n            .animate({width: &quot;100%&quot;})\n            .animate({fontSize: &quot;46px&quot;})\n            .animate({borderWidth: 30});\n    });\n});\n&lt;\/script&gt;\n<\/pre><\/div>\n\n\n<p>Beberapa metode jQuery tidak mengembalikan objek jQuery. Secara umum, setter yaitu metode yang menetapkan beberapa nilai pada pemilihan yang mengembalikan objek jQuery, yang memungkinkan kalian untuk dapat terus memanggil metode jQuery pada pilihan kalian. Sedangkan&nbsp;<em>getter<\/em>&nbsp;mengembalikan nilai yang diminta, jadi kalian tidak bisa terus memanggil metode jQuery pada nilai yang dikembalikan oleh getter.<\/p>\n\n\n\n<p>Contoh yang sering terjadi pada skenario ini adalah metode&nbsp;<strong><em>html()<\/em><\/strong>. Jika tidak ada parameter yang diteruskan ke sana, konten HTML dari elemen yang dipilih dikembalikan sebagai pengganti objek jQuery.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n&lt;script type=&quot;text\/javascript&quot;&gt;\n$(document).ready(function(){\n    $(&quot;button&quot;).click(function(){\n        \/\/ This will work\n        $(&quot;h1&quot;).html(&quot;Hello World!&quot;).addClass(&quot;test&quot;);\n         \n        \/\/ This will NOT work\n        $(&quot;p&quot;).html().addClass(&quot;test&quot;);\n    });\n});\n&lt;\/script&gt;\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Metode Chaining JQuery menyediakan fitur kuat lain yang disebut metode chaining yang memungkinkan kita untuk melakukan beberapa tindakan pada set elemen yang sama, semua dalam<\/p>\n","protected":false},"author":1,"featured_media":11743,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[4388,4391,4392,4390,4389,4387],"class_list":["post-11771","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-belajar-web-design","tag-belajar-jquery-chaining","tag-belajar-jquery-chaining-pemula","tag-kursus-jquery-chaining-bandung","tag-kursus-jquery-chaining-jakarta","tag-tutorial-jquery-chaining","tag-tutorial-jquery-chaining-pemula"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>jQuery : Chaining - WebHozz Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery : Chaining - WebHozz Blog\" \/>\n<meta property=\"og:description\" content=\"Metode Chaining JQuery menyediakan fitur kuat lain yang disebut metode chaining yang memungkinkan kita untuk melakukan beberapa tindakan pada set elemen yang sama, semua dalam\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHozz Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-21T08:01:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-19T08:21:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/person\\\/d5f539ad171dc74baaf6a98dfef6fcef\"},\"headline\":\"jQuery : Chaining\",\"datePublished\":\"2022-08-21T08:01:22+00:00\",\"dateModified\":\"2023-05-19T08:21:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/\"},\"wordCount\":205,\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/jQuery_1.jpg\",\"keywords\":[\"Belajar jQuery Chaining\",\"Belajar jQuery Chaining Pemula\",\"Kursus jQuery Chaining Bandung\",\"Kursus jQuery Chaining Jakarta\",\"Tutorial jQuery Chaining\",\"Tutorial jQuery Chaining Pemula\"],\"articleSection\":[\"Belajar Web Design\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/\",\"name\":\"jQuery : Chaining - WebHozz Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/jQuery_1.jpg\",\"datePublished\":\"2022-08-21T08:01:22+00:00\",\"dateModified\":\"2023-05-19T08:21:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/jQuery_1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/jQuery_1.jpg\",\"width\":\"750\",\"height\":\"400\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/jquery-chaining\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jQuery : Chaining\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\",\"name\":\"WebHozz Blog\",\"description\":\"Kursus Web &amp; Android di Jakarta Bandung\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#organization\",\"name\":\"WebHozz\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo-persegi.jpg\",\"contentUrl\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/logo-persegi.jpg\",\"width\":442,\"height\":442,\"caption\":\"WebHozz\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/#\\\/schema\\\/person\\\/d5f539ad171dc74baaf6a98dfef6fcef\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.webhozz.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery : Chaining - WebHozz Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/","og_locale":"en_US","og_type":"article","og_title":"jQuery : Chaining - WebHozz Blog","og_description":"Metode Chaining JQuery menyediakan fitur kuat lain yang disebut metode chaining yang memungkinkan kita untuk melakukan beberapa tindakan pada set elemen yang sama, semua dalam","og_url":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/","og_site_name":"WebHozz Blog","article_published_time":"2022-08-21T08:01:22+00:00","article_modified_time":"2023-05-19T08:21:56+00:00","og_image":[{"width":750,"height":400,"url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#article","isPartOf":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/"},"author":{"name":"admin","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/person\/d5f539ad171dc74baaf6a98dfef6fcef"},"headline":"jQuery : Chaining","datePublished":"2022-08-21T08:01:22+00:00","dateModified":"2023-05-19T08:21:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/"},"wordCount":205,"publisher":{"@id":"https:\/\/www.webhozz.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg","keywords":["Belajar jQuery Chaining","Belajar jQuery Chaining Pemula","Kursus jQuery Chaining Bandung","Kursus jQuery Chaining Jakarta","Tutorial jQuery Chaining","Tutorial jQuery Chaining Pemula"],"articleSection":["Belajar Web Design"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/","url":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/","name":"jQuery : Chaining - WebHozz Blog","isPartOf":{"@id":"https:\/\/www.webhozz.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#primaryimage"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg","datePublished":"2022-08-21T08:01:22+00:00","dateModified":"2023-05-19T08:21:56+00:00","breadcrumb":{"@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhozz.com\/blog\/jquery-chaining\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#primaryimage","url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg","contentUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2022\/08\/jQuery_1.jpg","width":"750","height":"400"},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhozz.com\/blog\/jquery-chaining\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhozz.com\/blog\/"},{"@type":"ListItem","position":2,"name":"jQuery : Chaining"}]},{"@type":"WebSite","@id":"https:\/\/www.webhozz.com\/blog\/#website","url":"https:\/\/www.webhozz.com\/blog\/","name":"WebHozz Blog","description":"Kursus Web &amp; Android di Jakarta Bandung","publisher":{"@id":"https:\/\/www.webhozz.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhozz.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhozz.com\/blog\/#organization","name":"WebHozz","url":"https:\/\/www.webhozz.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2018\/04\/logo-persegi.jpg","contentUrl":"https:\/\/www.webhozz.com\/blog\/wp-content\/uploads\/2018\/04\/logo-persegi.jpg","width":442,"height":442,"caption":"WebHozz"},"image":{"@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.webhozz.com\/blog\/#\/schema\/person\/d5f539ad171dc74baaf6a98dfef6fcef","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bff35e4083f3870e2f911c4437e788147d340f274268d361dd7e1cf20bebb156?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.webhozz.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/11771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/comments?post=11771"}],"version-history":[{"count":2,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/11771\/revisions"}],"predecessor-version":[{"id":12469,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/posts\/11771\/revisions\/12469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/media\/11743"}],"wp:attachment":[{"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/media?parent=11771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/categories?post=11771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhozz.com\/blog\/wp-json\/wp\/v2\/tags?post=11771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}