0

I have in javascript a text say I am an idiot

I want to do it. "I am...." and on mouseover it shows up I am an idiot.

How can I do it?

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by me655321
0

This what you're looking for?

<html>
<script>
var hideLength=7;
function showText(el){
	el.innerHTML=el.getAttribute("fulltext");
}
function hideText(el){
	if (el.getAttribute("fulltext").length > hideLength){
		el.innerHTML=el.getAttribute("fulltext").substr(0,hideLength-3)+"...";
	}
}
</script>
<body>
<span fulltext="Test this text." onmouseover="showText(this)" onmouseout="hideText(this)">Test...</span>
</body>
</html>
0

also i dont wanna use span.I am using inputtext, i want to do it inside textbox

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.