So I am programming a CMS type system so that a user can edit their own page. The way it is supposed to work is that the user can add as many containers as they want onto the page and each of those containers have their own text editor. Those text editors have their own buttons (Like bold, italics, ect). But when I have one container the buttons work just fine, but then when I have two containers the second piece of buttons do not work.
Here is my jquery code, (The bold, italic, ect functions work completely.) -
$('.bold').click( function() {
var mytext = bold();
});
$('.italic').click(function(){
var mytext = italic();
});
$('.left').click(function(){
var mytext = left();
});
$('.right').click(function(){
var mytext = right();
});
$('.center').click(function(){
var mytext = center();
});
And this is the button code. -
<div class="slots">
<input class="bold" type="button" value="">
<input class="italic" type="button" value="">
<input class="left" type="button" value="">
<input class="center" type="button" value="">
<input class="right" type="button" value="">
</div>
The problem is that, when I have only 1 button set it works, but when I have two button sets one works and the other does not.