Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Never use links for anything other than following a link, and even more so DO NOT use onclick="return false". Do not violate the semantics of layout. The link must link. And the action to open the modal can be hung on any element - whether it's a span or a div, or even better - a button. Positioning the button outside the form is perfectly valid, the comment above is incorrect. Using button will give one more advantage - native switching to the button by tab.
Yes, you can link. What's the problem?
<a href=# onclick= return false(чтобы не произошел переход)></a>
Depends on what's in that window. If some other page, then I would do something like this:
document.querySelector("a").onclick = function(e){
e.preventDefault();
window.open(this.href);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question