quick question
#1

I have a textfield

Код HTML:
<input type="text" name="example" id="exmaple_test" title="Loremipsum text" placeholder="Lorem Ipsum" autofocus />
Now I want to do this:
Onclick I want it to add a particular text like when I click on the textarea I want the text to turn the value of the textarea to 'Yay'. Any idea how I can do this? I tried ****** but no luck. :/
Reply
#2

that would be a javascript function I'll give it a try

PHP код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
script type="text/javascript">
function 
change() {
    
document.getElementById("example_test").value "Yay";
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<input type="text" name="example" id="example_test" title="Loremipsum text" placeholder="Lorem Ipsum"  onclick="change()" autofocus />
</body>
</html> 
works for me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)