+ 1
Please can someone explain to me what the target attribute is all about..i don't seem to understand..
2 odpowiedzi
+ 4
The attribute of a tag gives details about that tags e.g if I create an image tag <img>, it won't show any image, so I can specify the images source with the attribute "src" of my image tag like so
<img src="Image.png">
I can also specify the width and height of the image like so
<img src="Image.png" width="500px" height="500px">
NOTE!
Not all attributes can be given to every tag. For example, we can't give the <div> tag a source attribute src, it won't do anything!
Hope this was helpful.
+ 1
Omole David
target attribute in links tells the browser where to load the linked page in a browser.
Its default value is _self which means it loads the link in the same browsing context.
If you want the link to be opened in another tab in a browser, use _blank.
See this page:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a