For my project i've been working on. I have a piece of Javascript code that inserts text into an input element with it's label has been double clicked.
$(document).ready(function() {
$('#name-label').dblclick(function(){
$("#name").val('[b][color="#FF0000"]Please Submit![/color][/b]');
});
});
But I would like this code to work with multiple fields without copying and pasting the code over and over again. I would like the text inserted to stay the same.
Here are labels and input ID's I would like to use:
Label / Input
name-label / name
image-label / image
quest-label / quest
price-label / price
ge-label / ge
halch-label / halch
lalch-label / lalch
details-label / details
examine-label / examine
location-label / location
stats-label / stats
keywords-label / keywords