I have a contenteditable div fora text area, and I want to style it
<div id="reply_body{{forloop.counter}}" name="reply_body" contenteditable="true">Begin typing </div>
However, I am using {{forloop.counter}} because I am passing the information in the div to a javascript function. I.e.,
<script type="text/javascript">
function copycontent(x)
{
document.getElementById('replies'+x).value=
document.getElementById('reply_body'+x).innerHTML;
};
</script>
So, my question is, how can I style this contenteditable div if part of the id is {{forloop.counter}}?
Use a class to style it:
CSS:
ID’s (denoted by
#in CSS) have to be unique to an element, classes (denoted by.in CSS) can be used with multiple elements.