help with onClick more than one property
Posted: 06 May 2010 09:30 AM   [ Ignore ]
Newbie
Rank
Total Posts:  30
Joined  2010-04-25

the one for div doesn’t work at all.

<h6 style="left: 170px;” onClick="body.style.backgroundColor=’#3F382B’;div.style.backgroundColor=’#3F382B’;">grey</h6>

also is there a SIMPLE way to change the external css so this could be cleaner.

I gave a thanks in advance to everyone I’ll ever meet 2 years ago

_______________________________________________________

Los Angeles Website Design
Free Press Release Submission

Profile
 
 
Posted: 15 November 2010 02:53 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  2
Joined  2010-11-15

I am not a expert in javascript (i am php developer) but i thing that you must give an ID to this div element and write your code like:

onClick="body.style.backgroundColor=’#3F382B’;document.getElementBy(ID).style.backgroundColor=’#3F382B’;"

good luck.

Profile
 
 
Posted: 22 November 2010 04:48 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  8
Joined  2010-10-12

Am I right in thinking this should be in lowercase for full browser support?

Profile
 
 
Posted: 29 December 2010 01:28 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  2
Joined  2010-11-15

Lowercase or Upercase is the same.
magnet link

Profile
 
 
Posted: 16 January 2011 09:32 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  4
Joined  2011-01-16

Are you sure these are not case sensitive?
wordpress themes
web hosting

Profile
 
 
Posted: 03 April 2011 02:47 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  2
Joined  2011-04-03

I also find that there seems to be no difference between lower case and upper case in wordpress, although Google seems to track them as separate pages.
Alabama CNA Training

Profile
 
 
Posted: 06 May 2011 01:56 PM   [ Ignore ]   [ # 6 ]
Jr. Member
RankRank
Total Posts:  39
Joined  2007-08-25

I’d read up on jQuery as you can setup a function that runs when an action is performed or triggered on an element.  Just make sure your JS is in a separate JS file to avoid code bloat in your HTML.

Profile
 
 
Posted: 06 June 2011 02:09 PM   [ Ignore ]   [ # 7 ]
Sr. Member
RankRankRankRank
Total Posts:  133
Joined  2010-04-23

Case is irrelevant for onClick.
_____________________________
Running - Running Log
5k - 10k - Half Marathon - Marathon

Profile