The HTML below displays the date and time within the same DATE class. This is no good, because I want to style them independently. But I can't as is, so I thought jquery could be injected to split it up.
<div class="container">
<a class="title" href="http://www.example.com">Headlines Goes Here</a>
<div class="date">Jan 29, 2013 12:05:00 PM EST</div>
<div class="post">
<p>Content Goes Here</p>
</div>
</div>
I'm hoping with someone's help this could be solved with jquery by appending within the DATE class so the output would look like this:
<div class="container">
<a class="title" href="http://www.example.com">Headlines Goes Here</a>
<div class="date">Jan 29, 2013</div><div class="time">12:05:00 PM EST</div>
<div class="post">
<p>Content Goes Here</p>
</div>
</div>
This is my JQUERY so far, which I styled as red so I could see a physcal change, can someone help solve this issue? my jquery is clearly not correct.
$(window).load(function(){
if ($(".date:contains(', 2013')").length)
this.parentNode.append(this).html("</div><div class=time style=color:red>");
});
This is my fiddle: http://jsfiddle.net/3ZWkQ/
this.parentNode.append(this).html("</div><div class=time style=color:red>");This doesn't seem to be right...