I have the following markup:
<div>
<div class="form-action form-action-primary">
<button class="button button-chevron-right button-primary" name="next" type="submit" value="Next">
Next
<span class="icon icon-icon-cta"></span>
</button>
</div>
</div>
and the following javascript to remove the button:
window.onload = function (){
var elem = document.getElementsByName('next');
console.log(elem);
elem.parentNode.removeChild(elem);
};
but I get the following error:
Uncaught TypeError: Cannot read property 'removeChild' of undefined
at window.onload
console.log returns:
NodeList [button.button.button-chevron-right.button-primary]