Superb advice PanBB.RU it did the trick! Thank you!
1 2017-03-21 09:01
Re: Fixed! Need help w/ toggling anchor + button (4 replies, posted in Programming)
2 2017-03-20 13:24
Re: Fixed! Need help w/ toggling anchor + button (4 replies, posted in Programming)
HTML:
<button class='red' id='js-button'>Нажать</button>
CSS:
.red { color: red; } .green { color: green }
JavaScript:
$('#js-button').on('click', function(){ if ($(this).hasClass('red')) { $(this).removeClass('red').addClass('green').html('Ещё раз'); return } $(this).removeClass('green').addClass('red').html('Нажать'); });
Will give it a shot, thank you for the snippets
3 2017-03-20 10:29
Re: Fixed! Need help w/ toggling anchor + button (4 replies, posted in Programming)
Nobody has any ideas as to how I can fix this?
4 2017-03-17 12:36
Topic: Fixed! Need help w/ toggling anchor + button (4 replies, posted in Programming)
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 ?