Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Need help w/ toggling anchor + button


  • Please log in to reply
No replies to this topic

#1 Ram-girl

Ram-girl

  • Members
  • 12 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:Denmark
  • Local time:06:17 PM

Posted 15 March 2017 - 07:43 AM

How can i make a jQuery script that toggles visibility of a div and at the same time toggles anchor text of a button?
 
function toggle(user_id) {
   e = document.getElementById('toggleUserinfo_' + user_id);
   a = document.getElementById('displayUserinfo_' + user_id);
   if (e.style.display == 'block') {
       e.style.display = 'none';
       a.innerHTML = ‘Open';
   } else {
       e.style.display = 'block';
       a.innerHTML = ‘Close';
   }
}
 
I tried to search for it and came up with the following. However i want something more clean and based on jQuery instead of javascript. I need the script to show more information in the table with a button here.
 
Any ideas ?


BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users