I am trying to remove the contenteditable attribute, or at-least set it to false when another element has been clicked. This is what I tried so far:
group.click(function(){
var $this = $(this);
group.removeClass("selected");
isEditable.attr('contenteditable', false)
$this.addClass("selected");
isEditable.attr('contenteditable', true).css("cursor", "text");
});
Preview & all code: http://jsbin.com/ekufeb/3 (Select one of the text)
The purpose is to apply css to the selected element only cursor: pointer; but when I select one element, it applies to all that is in the isEditable variable. Which is:
isEditable = $(".grouptitle, .username, .text");
Any way of doing this? Hopefully the preview will help.
You can also use
removeAttrto remove any attribute from an element. so in your case it will beIf you want to select elements which has
contenteditableattribute or it is true use this.