I want to set the src
of an image to the return value of a function call. Here is what I am doing now:
<img src="get_src()" alt="can't display picture" />
and the script is:
function get_picA() {
return "picA.png";
}
But it doesn't work.
You can't set it like that.
You can change the value with javascript:
You can't do it that way. The
src
attribute doesn't interpret javascript.You may do it like this: