Please can someone explain to me what the target attribute is all about..i don't seem to understand.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please can someone explain to me what the target attribute is all about..i don't seem to understand..

25th Jul 2020, 12:29 AM
gods brayne
gods brayne - avatar
2 Answers
+ 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.
25th Jul 2020, 1:09 AM
Vachila64☕
Vachila64☕ - avatar
+ 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
25th Jul 2020, 2:48 AM
Hanuma Ukkadapu
Hanuma Ukkadapu - avatar