{"id":8334,"date":"2022-06-13T14:47:37","date_gmt":"2022-06-13T14:47:37","guid":{"rendered":"http:\/\/phpcodez.com\/?p=8334"},"modified":"2022-06-13T14:47:37","modified_gmt":"2022-06-13T14:47:37","slug":"access-html-element-javascript","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/access-html-element-javascript\/","title":{"rendered":"Access HTML Element JavaScript"},"content":{"rendered":"<p>Here are the ways an HTML element can be accessed in a JavaScript code:<\/p>\n<ul>\n<li>getElementByClass(\u2018classname\u2019): Gets all the HTML elements that have the specified classname.<\/li>\n<li>getElementById(\u2018idname\u2019): Gets an HTML element by its ID name.<\/li>\n<li>getElementbyTagName(\u2018tagname\u2019): Gets all the HTML elements that have the specified tagname.<\/li>\n<li>querySelector(): Takes CSS style selector and returns the first selected HTML element.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here are the ways an HTML element can be accessed in a JavaScript code: getElementByClass(\u2018classname\u2019): Gets all the HTML elements that have the specified classname. getElementById(\u2018idname\u2019): Gets an HTML element by its ID name. getElementbyTagName(\u2018tagname\u2019): Gets all the HTML elements that have the specified tagname. querySelector(): Takes CSS style selector and returns the first selected &hellip; <a href=\"http:\/\/phpcodez.com\/access-html-element-javascript\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Access HTML Element JavaScript<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[231,260],"class_list":["post-8334","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-html","tag-javascript"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=8334"}],"version-history":[{"count":1,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8334\/revisions"}],"predecessor-version":[{"id":8335,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/8334\/revisions\/8335"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=8334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=8334"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=8334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}