Answer the question
In order to leave comments, you need to log in
Why does setAttribute() throw an Uncaught TypeError: name.setAttribute is not a function?
I want to add an attribute to an element
oninvalid="this.setCustomValidity('Введите своё имя')"
<script>
var name = document.getElementById("MyName");
name.setAttribute("oninvalid", "this.setCustomValidity('Введите своё имя')");
</script>
Answer the question
In order to leave comments, you need to log in
Background with background-size, background-position
A block that runs over the background, so just margin-top -Npx or move it a little through position relative if it is somehow above the flow in the design,
But certainly not through absolute
Create a menu after this banner and indent it with either margin or position: absolute.
Better second option
document.querySelector('#MyName').addEventListener('invalid', function(){
this.setCustomValidity('Введите своё имя')
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question