# Javascript and textboxes

**URL:** <https://forum.kirupa.com/t/javascript-and-textboxes/27425>\
**Category:** programming\
**Created:** [August 2, 2003, 8:32am UTC](https://forum.kirupa.com/t/javascript-and-textboxes/27425 "2003-08-02T08:32:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JK87](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JK87](https://forum.kirupa.com/u/JK87)\
**Post date:** [August 2, 2003, 8:32am UTC](https://forum.kirupa.com/t/javascript-and-textboxes/27425/1 "2003-08-02T08:32:40Z")

</div>

I imagine that DP will be the one to respond to this since he seems pretty clued up on Javascript right now. Basically, I was wondering what code would be required to do the following with Javascript :

You have a textbox which is not editable by the user. When the user moves the cursor over certain images, certain text/numbers should appear in the textbox.

e.g. If you move your mouse over image x.jpg, some text saying “Close the window” appears in the textbox. [note, that’s just an example].

I know absolutely nothing when it comes to javascript so please try to explain it as well as possible :).

Thanks,  
JK.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 2, 2003, 8:53pm UTC](https://forum.kirupa.com/t/javascript-and-textboxes/27425/2 "2003-08-02T20:53:16Z")

</div>

Well here you go. If you don’t want to make it a textbox and say a SPAN or P tag then just change the slap the ID on it and match it up accordingly when you execute the function

```php

<SCRIPT>
	function chgText(obj) {
		obj.innerText = "blah";
	}
	</SCRIPT>
<A href="javascript:chgText(textBlah);">Blah?</A>

<INPUT id="textBlah" type="text" value="RollOver a link" disabled>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 3, 2003, 5:42am UTC](https://forum.kirupa.com/t/javascript-and-textboxes/27425/3 "2003-08-03T05:42:10Z")

</div>

I’ll give it a whack. Cheers :).
