dramasea
dramasea

Reputation: 3490

what is .src in JavaScript?

What is .src in the JavaScript code below?

function jsDropDown(imgid,folder,newimg) {
    document.getElementById(imgid).src="http://www.cookwithbetty.com/" + folder + "/" + newimg + ".gif";
}

Upvotes: 3

Views: 19616

Answers (4)

Hugolpz
Hugolpz

Reputation: 18258

src is in computer programming, a common abbreviation for source code.

Upvotes: -2

Shakti Singh
Shakti Singh

Reputation: 86406

src is the property of <img> tag and can be accessed by javascript to assing the image url

Upvotes: 0

Quentin
Quentin

Reputation: 943569

It maps onto the src attribute of the img element. (Although this is DOM rather than JS)

Upvotes: 1

Nick Craver
Nick Craver

Reputation: 630429

It's the src DOM property of the <img> element that it's dealing with.

Upvotes: 8

Related Questions