... New Photos

In recent times, it has become quite a trendy and nifty trick to show a live comment preview on a lot of blog websites. I remember just how excited i was the first time i saw this in action on a dotnet blogengine application. In this article i will show you how to implement a live comment preview on your website with just simple javascript and HTML.

Okay, to get started i will start by creating a javascript(.js) file with the following on it.

As you can see the javascript is almost self explanatory. First, I declared variables and i assigned various id's of the HTML elements i cared about to them from our page. Finally i take the value of the entered comment and placed it as the value of the comment preview.

Some of the HTML

<textarea id="CommentBody"></textarea>

Finally, i added a HTML Onclick attribute with the Javascript function call to the textarea to wire up the HTML and the javascript method together for the final trick.

That's it ... pretty easy thing to do. I hope you will enjoy building it on your own website. Good luck.

The same people who want to restrict the right to keep and bear arms of law-abiding citizens believe the Boston Marathon bomber should be given the right to vote on death row, Pence said, drawing boos from the crowd. I got news for you, Bernie: Not on our watch! Violent convicted felons, murderers, and terrorists should never be given the right to vote in prison — not now, not ever.

Jones' relatives asked Judge Joseph Marx to give Raja the maximum sentence of life in prison during the sentencing hearing. The judge said it was a "heartbreaking" case before handing down the sentence of 25 years, the minimum required under state law, for both counts, to run concurrently.