Solved

setAttribute in Firefox

Posted on 2006-11-04
4
1,018 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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

615 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