Disable Button 2 - Not posting my Message


#1

For Disable the button 2; it is telling me everything is correct and lets me move on though, When I click post in the status bar, my message is not visible; my code is

var main = function() {
$('.btn').click(function() {
var post = $('.status-box').val();
$('li').text(post).prependTo('.posts');
$('.status-box').val('');
$('.counter').text("140");
$('.btn').addClass('disabled');
});
$('.status-box').keyup(function() {
var postLength = $(this).val().length;
var charactersLeft = 140 - postLength;
$('.counter').text(charactersLeft);

if (charactersLeft < 0){
$('.btn').addClass('disabled');

}else if (charactersLeft <= 140){
$('.btn').removeClass('disabled');

}else{
$('btn').removeClass('disabled');
}

});
$('.btn').addClass('disabled');
}
$(document).ready(main);


#2

What happens when you try this?

$('<li>').text(post).prependTo('.posts');

#3

Thank you so much yeah it worked!! Thanks Heaps! :DD


#4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.