I'm trying to create a div inside a p with a click function. But it seems not to close my p element. Apparently after reading this, it seems that if the p element is immediately followed by a div in this case it doesn't require a closing tag at the end.
<div class="main"></div>
<div class="content-list"><ul class="information"> </ul></div>
I'm going to append to the with this function:
var $contentHandler = $(".content-list");
var $mainHandler = $(".main");
var $infoHandler = $(".information");
var circleCounter = 1;
$mainHandler.click(function() {
var htmlString = "<li class='" + circleCounter + "'> <p class='circle-color'> var color = <div class='circle-color-input' contentEditable autocorrect='off'> type a color</div> ; </p> <p class='circle-radius'> </p> <p class='circle'> </p> </li>"
$infoHandler.append(htmlString);
circleCounter++;
});
Here is the code for that
http://jsfiddle.net/mauricioSanchez/tJkex/
Is there any way around this?
Thanks!