JS noob question:
I'm trying to manipulate the HTMLCollection of a Wordpress plugin and I failed for some hours now. I want to delete the property "baseURI" or set it to null.
jQuery(document).ready(function( $ ){
//HTML Collection
var test = document.getElementsByClassName("post-2968");
//manipulate <a> object inside <div>
test[0].childNodes[0].target="_blank";
test[0].childNodes[0].href="www.google.com";
//manipulte property of div
test[0].baseURI = undefined; // also tried "" or null
console.log(test)
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
This is the log: Console.logg
As is written in the documentation:
The baseURI --->read-only<---- property returns the absolute base URL of a Node.
So I don't think you can change it.