{"id":5222,"date":"2021-10-06T02:00:00","date_gmt":"2021-10-06T00:00:00","guid":{"rendered":"https:\/\/alvarotrigo.com\/epa\/javascript-select-option\/"},"modified":"2024-02-08T00:33:52","modified_gmt":"2024-02-07T23:33:52","slug":"javascript-select-option","status":"publish","type":"post","link":"https:\/\/alvarotrigo.com\/blog\/javascript-select-option\/","title":{"rendered":"Change &#8220;Select&#8221; Option Using JavaScript [With Examples]"},"content":{"rendered":"\n<p><strong>To change the selected option in an HTML <code>&lt;select&gt;<\/code> element you have to change the <code>value<\/code> property on the <code>&lt;select&gt;<\/code> element or the <code>selected<\/code> property on the <code>&lt;option&gt;<\/code> element you want to select.<\/strong><\/p>\n\n\n\n<p>There are multiple ways you can do it and choosing one or another will depend on the information you have available.<\/p>\n\n\n\n<p>Let&#8217;s see 6 different ways of changing the selected option using JavaScript:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1.-change-select-option-by-value\">1. Change Select Option by Value<\/h2>\n\n\n\n<p>To change the selected option programmatically by the <code>value<\/code> attribute, all we have to do is change the <code>value<\/code> property of the <code>&lt;select&gt;<\/code> element.<\/p>\n\n\n\n<p>The select box will then update itself to reflect the state of this property. This is the most straightforward way of updating a select box state.<\/p>\n\n\n\n<p>Let&#8217;s say that we want to select the option containing the attribute <code>value=\"steve\"<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">select<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"my-select\"<\/span>&gt;<\/span>\n   <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"ann\"<\/span>&gt;<\/span>Ann Frank<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n   <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"paul\"<\/span> <span class=\"hljs-attr\">selected<\/span>&gt;<\/span>Paul Allen<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n   <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">option<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\">\"steve\"<\/span>&gt;<\/span>Steve Jobs<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">option<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">select<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>All we have to do is set the value of the select box to that same value:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">const<\/span> changeSelected = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n  <span class=\"hljs-keyword\">const<\/span> $select = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>);\n  $select.value = <span class=\"hljs-string\">'steve'<\/span>\n};\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_xxrvEgP\" data-src=\"\/\/codepen.io\/anon\/embed\/xxrvEgP?height=450&amp;theme-id=1&amp;slug-hash=xxrvEgP&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed xxrvEgP\" title=\"CodePen Embed xxrvEgP\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2.-change-select-option-by-text\">2. Change Select Option by Text<\/h2>\n\n\n\n<p>We might also want to change the value of a select box by the text of the <code>&lt;option&gt;<\/code> element that gets displayed to visitors.<\/p>\n\n\n\n<p>Doing this is probably the most complicated way, but still, something relatively simple to do. We have to iterate over the options and compare their text with the text of the element we want to select.<\/p>\n\n\n\n<p>Once we find the element we want to update, we&#8217;ll be updating its <code>selected<\/code> property and setting it to <code>true<\/code>. This way, the select box will also update itself to reflect this change.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Note: this only works for select box elements that only admit a single value. If you are using a <a href=\"https:\/\/www.w3schools.com\/tags\/att_select_multiple.asp\" target=\"_blank\" rel=\"noopener nofollow\">select box admiting multiple selected elements<\/a> this will just add another option to the multi-select instead of changing the active one for another.<\/p>\n<\/blockquote>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">const<\/span> changeSelected = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n  <span class=\"hljs-keyword\">const<\/span> text = <span class=\"hljs-string\">'Steve Jobs'<\/span>;\n  <span class=\"hljs-keyword\">const<\/span> $select = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>);\n  <span class=\"hljs-keyword\">const<\/span> $options = <span class=\"hljs-built_in\">Array<\/span>.from($select.options);\n  <span class=\"hljs-keyword\">const<\/span> optionToSelect = $options.find(<span class=\"hljs-function\"><span class=\"hljs-params\">item<\/span> =&gt;<\/span> item.text ===text);\n  optionToSelect.selected = <span class=\"hljs-literal\">true<\/span>;\n};\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_WNOVGEv\" data-src=\"\/\/codepen.io\/anon\/embed\/WNOVGEv?height=450&amp;theme-id=1&amp;slug-hash=WNOVGEv&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed WNOVGEv\" title=\"CodePen Embed WNOVGEv\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>There&#8217;s another way of doing this and that will solve the problem with multi-select inputs. Basically, once we find the element that has the text we are looking for, instead of just changing its <code>selected<\/code> property, we&#8217;ll be getting its <code>value<\/code> attribute and using it to set it as the only value for the whole select box.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">const<\/span> changeSelected = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n  <span class=\"hljs-keyword\">const<\/span> text = <span class=\"hljs-string\">'Steve Jobs'<\/span>;\n  <span class=\"hljs-keyword\">const<\/span> $select = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>);\n  <span class=\"hljs-keyword\">const<\/span> $options = <span class=\"hljs-built_in\">Array<\/span>.from($select.options);\n  <span class=\"hljs-keyword\">const<\/span> optionToSelect = $options.find(<span class=\"hljs-function\"><span class=\"hljs-params\">item<\/span> =&gt;<\/span> item.text ===text);\n\n  <span class=\"hljs-comment\">\/\/ Here's the trick:<\/span>\n  $select.value = optionToSelect.value;\n};\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_oNwKWLO\" data-src=\"\/\/codepen.io\/anon\/embed\/oNwKWLO?height=450&amp;theme-id=1&amp;slug-hash=oNwKWLO&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed oNwKWLO\" title=\"CodePen Embed oNwKWLO\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3.-change-select-option-by-option-id%2C-class%2C-or-attribute\">3. Change Select Option by Option ID, CLASS, or attribute<\/h2>\n\n\n\n<p>This is quite simple too. This solution will also work for multi-select inputs by assigning a single value to them:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">const<\/span> changeSelected = <span class=\"hljs-function\">(<span class=\"hljs-params\">e<\/span>) =&gt;<\/span> {\n    <span class=\"hljs-keyword\">const<\/span> $select = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>);\n    <span class=\"hljs-keyword\">const<\/span> $option = $select.querySelector(<span class=\"hljs-string\">'#myId'<\/span>);\n    $select.value = $option.value;\n};\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_yLXmaxM\" data-src=\"\/\/codepen.io\/anon\/embed\/yLXmaxM?height=450&amp;theme-id=1&amp;slug-hash=yLXmaxM&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed yLXmaxM\" title=\"CodePen Embed yLXmaxM\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>And of course, it can be done in the same way if we have a <code>class<\/code> attribute instead of an <code>id<\/code> or any other attribute like <code>data-selected=\"true\"<\/code>. Just change the query to get the option element:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Using id<\/span>\n<span class=\"hljs-keyword\">const<\/span> $option = $select.querySelector(<span class=\"hljs-string\">'#myId'<\/span>);\n\n<span class=\"hljs-comment\">\/\/ Using classname<\/span>\n<span class=\"hljs-keyword\">const<\/span> $option = $select.querySelector(<span class=\"hljs-string\">'#mySelect .myId'<\/span>);\n\n<span class=\"hljs-comment\">\/\/ Using data-attribute<\/span>\n<span class=\"hljs-keyword\">const<\/span> $option = $select.querySelector(<span class=\"hljs-string\">'#mySelect &#91;data-selected=\"myElement\"]'<\/span>);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"4.-change-selected-option-by-its-index\">4. Change Selected Option by its Index<\/h2>\n\n\n\n<p>If all we have is the index of the option element, we can set <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/option#attr-selected\" target=\"_blank\" rel=\"noopener nofollow\">the <code>selected<\/code> attribute<\/a> by retrieving the <code>select<\/code> box options. Then we only have to select the one we need from the array by its index.<\/p>\n\n\n\n<p>Notice that the index is 0-based. So, the first <code>&lt;option&gt;<\/code> element will have index <code>0<\/code>, the next <code>1<\/code>, and so forth.<\/p>\n\n\n\n<p>Knowing this, if we want to select the 3rd element, we&#8217;ll be using index 2 in our code to select it:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Selecting the 3rd option (Demo 2)<\/span>\n<span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>).querySelector(<span class=\"hljs-string\">'option'<\/span>)&#91;<span class=\"hljs-number\">2<\/span>].selected = <span class=\"hljs-string\">'selected'<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Let&#8217;s see it working on a click event:<\/p>\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_ZEygpGW\" data-src=\"\/\/codepen.io\/anon\/embed\/ZEygpGW?height=450&amp;theme-id=1&amp;slug-hash=ZEygpGW&amp;default-tab=js,result\" height=\"450\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed ZEygpGW\" title=\"CodePen Embed ZEygpGW\" class=\"cp_embed_iframe lazyload\" style=\"width:100%;overflow:hidden\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\">CodePen Embed Fallback<\/iframe><\/div>\n\n\n\n<p>And rewritten to work for multi-select inputs:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Selecting the 3rd option (Demo 2)<\/span>\n<span class=\"hljs-keyword\">const<\/span> $select = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'#mySelect'<\/span>);\n$select.value = $select.querySelector(<span class=\"hljs-string\">'option'<\/span>)&#91;<span class=\"hljs-number\">2<\/span>].value;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>Remember that, no matter what way you choose to use to <strong>replace and change the selected element on your <code>&lt;select&gt;<\/code> elements<\/strong>, you&#8217;d be better off updating the <code>value<\/code> property if you want a single element to be selected. Otherwise, when having select boxes admitting multiple elements you won&#8217;t replace the active element but just add another one.<\/p>\n\n\n\n<p>Now you know how to set the value of a <code>&lt;select&gt;<\/code> element dynamically with JavaScript!<\/p>\n\n\n\n<p>If you are learning JavaScript and this seems a bit difficult for you, there&#8217;s nothing to worry about! Eventually, you&#8217;ll get there. See <a href=\"https:\/\/alvarotrigo.com\/blog\/learn-javascript\/\">how long does it take to learn JavaScript<\/a> and <a href=\"https:\/\/alvarotrigo.com\/blog\/best-way-learn-javascript\/\">what&#8217;s the best way to learn JavaScript<\/a>!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"related-articles\">Related articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/change-css-javascript\/\">Change CSS styles with JavaScript<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/disable-button-jquery\/\">Disable Button with jQuery (With Examples)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/replace-text-with-jquery\/\">Replace Text with jQuery (With Examples)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/jquery-checkbox-checked\/\">Best Ways to Check If a Checkbox Is Checked with jQuery<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/javascript-alert\/\">JavaScript Alert (Examples and Usage)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/alvarotrigo.com\/blog\/prevent-scroll-on-scrollable-element-js\/\">Prevent Scroll On Scrollable Elements<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>To change the selected option in an HTML `<select>` element we have to change the `value` property on the `<select>` element.<\/p>\n","protected":false},"author":1,"featured_media":5221,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[107],"tags":[10,18],"class_list":["post-5222","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-javascript","tag-jquery"],"acf":[],"_links":{"self":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/comments?post=5222"}],"version-history":[{"count":4,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5222\/revisions"}],"predecessor-version":[{"id":8840,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/posts\/5222\/revisions\/8840"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media\/5221"}],"wp:attachment":[{"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/media?parent=5222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/categories?post=5222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alvarotrigo.com\/blog\/wp-json\/wp\/v2\/tags?post=5222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}