This is my current code. I'm hoping to make a tiny cross browser markdown editor for only a few tiny controls. This is what I have so far:
http://jsfiddle.net/spadez/c3hHC/3/
What I want to do is get my current selection in jquery (if anything in the text box is selected) and if bold is clicked, both prepend and append the selected text with this:
**
It seems like to encase the selected text in two stars either side when the bold button is clicked I need to do the following:
Listen for a click: .click(function()
append: .append()
prepend: .prepend()
Can anyone help me get the current selection using jquery so I can add the stars to either side please?