Solved

setAttribute in Firefox

Posted on 2006-11-04
4
1,017 Views
Last Modified: 2012-05-05
The following script works perfectly in Internet explorer.
but it does nothing in FireFox. How can I modify it work
in FireFox too.

thanks for your help
--------------------------------------------------------------------------------
<style>
.imgCls {border: none;}
.imgClsClick {border: 1px solid black;}
</style>
<img src="japnuma.png" onmousedown="setAttribute('className', 'imgClsClick');" onmouseup="setAttribute('className', 'imgCls');" />
0
Comment
Question by:MnInShdw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 17875238
MnInShdw,

Try using the code below.

<img src="japnuma.png" onmousedown="this.className='imgClsClick';" onmouseup="this.className='imgCls';" />

Let me know if this doesn't work in both.  Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 17875251
As an FYI, this works in FF:
<img src="japnuma.png" onmousedown="setAttribute('class', 'imgClsClick');" onmouseup="setAttribute('class', 'imgCls');" />

But will not work in IE :)

So use b0lsc0tt's version :)
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 17875298
Million thanks for your quick help
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17875335
Your welcome!  I'm glad that I could help.  Thank you for the grade, the points and the fun question.

bol
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Word Press Fixes to Google Speed Test Issues 2 50
How do I split a variable to newline 2 44
Where is this content coming from? 4 40
display data from multiple ajax calls 9 43
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question