Let's make a link!
safejourney-art
Posted on October 29, 2019
Hello!
Have you ever made a link? Yes, maybe the answer is yes. Unless your website is a single page application, a link would be there.
Well, how do you make a link?
The answer is, use an anchor tag like
<a>Link</a>
Another question is here. Have you ever imagined the whole background is a link?
JavaScript can make it real.
More generally, JavaScript can make a link anywhere you want!
The magic word is "onclick." If you write it inside the body element, you can make the whole background a link. The code which realises it is for example (onclick="link()"):
function link(){
location.href = "url or path";
}
body, div, button, even anchor, anywhere can be made a link!
Sure that you are getting closer to your beautiful imaginations.
Safe journey!
I almost forgot. There is one more thing.
For you, I have created a JavaScript website. Many things JavaScript can draw are there.
Posted on October 29, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 8, 2024