Time remaining:
How do you change an elements class in JavaScript?

Computer Science
Tutor: None Selected Time limit: 0 Hours

I have an existing script. where i have it marked, i would also like to remove an existing class. How would i do that? i have never even attempted to mess with JavaScript until today.

$(function () {

var msie6 = $.browser == 'msie' && $.browser.version < 7;

if (!msie6) {
var top = $('#comment').offset().top - parseFloat($('#comment').css('margin-top… 0));
$(window).scroll(function (event) {
// what the y position of the scroll is
var y = $(this).scrollTop();

// whether that's below the form
if (y >= top) {
// if so, ad the fixed class
$('#comment').addClass('fixed'); RIGHT HERE!!!!
} else {
// otherwise remove it
$('#comment').removeClass('fixed');
}
});

});
Nov 30th, -0001
whats the problem in it. its working fine for me.
the line $('#comment').removeClass('fixed');
removes the class.
what problem are u facing in it?
Jul 15th, 2013

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Nov 30th, -0001
...
Nov 30th, -0001
Dec 9th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer