jQuery toggleClass example
Toggle class name on click in jQuery
HTML
<input type="text">
JavaScript
$('input').on('input', function(){
$(this).before( $('<div/>', {text: '-'}) );
$(this).after( $('<div/>', {text: '-'}) );
});
<input type="text">
$('input').on('input', function(){
$(this).before( $('<div/>', {text: '-'}) );
$(this).after( $('<div/>', {text: '-'}) );
});