Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Set input value onclick

What is wrong with my code?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Demo</title>
</head>
<body>
<form onsubmit="insertMedia();return false;" action="#">
<input id="src" name="src" type="text" value="" onchange="switchType(this.value);generatePreview();" />
</form>
<div onclick="document.getElementById('src').obj.value = 'hello world'">click here</div>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks . That was an easy fix