Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Davis Rousseau
Davis Rousseau
6,670 Points

What tag is this?

Some one asked me about what tag is this? Saying they need to allocate the tag to a specific type. This is for a banner ad. I'm new to Javascript not sure how to answer this.

Here the Javascript I came up with thanks

<script type='text/javascript'> var img = new Image(); img.src = 'http://www.medline.com/media/assets/images/ads/Web-Ad-Gloves-Super-Rectangle-Ad-final.gif'; img.onclick = function() { window.location.href = 'http://www.aloetouch.com/request-samples.asp?cmpid=bid=PO:Aloetouch-Request-a-Free-Sample:BANNER'; }; document.body.appendChild(img); </script>

3 Answers

Kerel Lacy
Kerel Lacy
8,474 Points

Could you put this in JSFiddle ?

Matt Monaco
Matt Monaco
2,563 Points

as far as I know there is no "type" attribute for <img> tags list of img attributes: http://www.w3schools.com/TAGS/tag_img.asp

do they possibly want a data-type? i.e.

<img src="" data-type="" />
Davis Rousseau
Davis Rousseau
6,670 Points

Thanks they wanted a javascript tag