Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to compare html value in jQuery
Old 11-22-2010, 04:07 AM How to compare html value in jQuery
Junior Talker

Posts: 3
Name: Anes P.A
Trades: 0
Hi Friends,
In one of my application I need a particular Toggle , If "+" is there then on further
click it become "-". I just plan to compare the Previous value and work according same,
but it alert Correctly but not Work...

This is my Test Function

Code:
function view_details(id) {
  alert("val is:"+$("#exp"+id).text());    
  $("tr[id^=view_details]").hide();
  $("span[id^=exp]").html('+');
  if ($("#exp"+id).text() == "+" )
  {
  alert("IF");    
  $("#view_details"+id).show();
  $("#exp"+id).addClass('expand');
  $("#exp"+id).html('-');    
  } else {
  alert("else");    
  $("#view_details"+id).hide();
  $("#exp"+id).html('+');
  }    
  }
it only Enter in IF case if the Text is actually "-" too... pls Advise me a Solution ASAP.


thankfully
Anes P.A
admod is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-24-2010, 12:49 PM Re: How to compare html value in jQuery
CSM
CSM's Avatar
Front-End Developer

Posts: 297
Name: Michael Pehl
Location: Palma de Mallorca
Trades: 0
Do you have an online version of this stuff?
__________________
Chief Web Officer / Front-End Developer / System Engineer

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
CSM is offline
Reply With Quote
View Public Profile Visit CSM's homepage!
 
Reply     « Reply to How to compare html value in jQuery
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22821 seconds with 12 queries