I want to insert smiley code in text area under cursor position by clicking on images.
There are three images in div #smiles:
And array
var smiles = {
'happy': ':)',
'sad': ':(',
'normal': ':|'
};
Textarea is #text
I don't know is it ok to use images' urls for connection with code, or there is better way (for example, by position).
Can you, please, help me to write the code. I will learn by it :)