The Little Guy Posted January 22, 2010 Share Posted January 22, 2010 I have the following html, but when the user clicks on the outer span the onclick works unless he/she clicks on the text that in one of the two inner spans. <span class="operationBlock" id="sortBy" onclick="displayOptions(event, this.id, 'sortBy_itms');"><span id="sName">Newest First</span> <span class="web">6</span></span> Below is my little example, if you click on the text the onclick doesn't work, if you click outside the text (where the padding is) the onclick does work... Why? [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
meomike2000 Posted January 22, 2010 Share Posted January 22, 2010 seemed to work fine for me, what browser u using...... Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 23, 2010 Author Share Posted January 23, 2010 Google Chrome Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 24, 2010 Author Share Posted January 24, 2010 anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
Zane Posted January 25, 2010 Share Posted January 25, 2010 sounds like you have the onclick placed in the wrong element.. try putting it in the inner span. Looking at your code.. You've got Button SPAN------ | |---Name of Button SPAN |---Arrow Character SPAN You've got the onclick set for the parent and not the text or arrow. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 25, 2010 Author Share Posted January 25, 2010 I just tried it with the onclick in the text span and it still doesn't work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.