This maybe a really simple question but for some reason my code isn't working.
Basically, if a user clicks on a piece of text which has the container class of .valueSD, I want the text to change into a select box so they can update the value of it.
Here is an example of what I did:
$('.valueSD').click(function(){
$('.valueSD').html( function(){
var monthDrop = '<td class="valueSD">'+
'<select name="date-month">'+
'<option name="01">January</option>'+
'<option name="02">February</option>'+
'<option name="03">March</option>'+
'<option name="04">April</option>'+
'<option name="05">May</option>'+
'<option name="06">June</option>'+
'<option name="07">July</option>'+
'<option name="08">August</option>'+
'<option name="09">September</option>'+
'<option name="10">October</option>'+
'<option name="11">November</option>'+
'<option name="12">December</option>'+
'</select>'+
'</td>';
console.log( monthDrop );
return monthDrop;
});
});
For some reason it doesn't work though.
Any ideas why?
html()function, like$('#valueSD').html('<td class... etc etc');