C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




javascript


Posted Date: 18 Jul 2008      Total Responses: 1

Posted By: kunal badgujar       Member Level: Gold     Points: 1



hi..
i have two images on my web form and i have 2 lables.now i want when i mouseover image1 lable1 text should change.and same for lable2 text should change mouseover on image2.but by using javascript.





Responses

Author: Kundan Kumar Sinha    21 Jul 2008Member Level: GoldRating:     Points: 6

Hi, Use the following code.


<html>
<head>
<script type="text/javascript">
function getValue(i)
{
if(i=='1'){
var x=document.getElementById("img1")
x.innerHTML = 'Image1';
}
else
{
var x=document.getElementById("img2")
x.innerHTML = 'Image2';
}
}
</script>
</head>
<body>
<h1>Move the mouse over image to see the caption.</h1>

<table border="1">
<tr>
<td width="50%"><img src="Image1.jpg" width="100" height="100" onmouseover="getValue(1)" /></td>
<td width="50%"><img src="Image2.jpg" width="100" height="100" onmouseover="getValue(2)" /></td>
</tr>
<tr>
<td> <div id="img1"></div></td>
<td> <div id="img2"></div></td>
</tr>
</table>
</body>
</html>



Post Reply
You must Sign In to post a response.
Next : Navigate to different page on confirmation from dropdownlist selected value
Previous : number of occurence of a word in a web page
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use