Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

setAttribute in Firefox

Posted on 2006-11-04
4
Medium Priority
?
1,020 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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…

670 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