jQuery Duplicate Selector-Fehler

Ich versuche derzeit, eine Tabelle mit 6 anklickbaren Zellen einzurichten, in der ein Eingabefeld angezeigt werden kann, damit Sie Kommentare hinzufügen können. Es wird jedoch ein doppelter Fehler bei der jQuery-Auswahl angezeigt, und ich habe dies auch beim Debuggen meiner zweiten Funktion festgestellt.html() funktioniert auch nicht. Hier ist mein Code für die 6 Funktionen; Jedes wird aufgerufen, wenn auf eine bestimmte Zelle geklickt wird:

$("#mondayCommentLink").click(function (){
    var mondayhtmls = $("#mondayComment");
    var input = $("<input type='text' id='mondayCommentText' name='mondayCommentText'  />");
    input.val(data.days[0].comment);
    mondayhtmls.html(input);
});

$("#tuesdaysCommentLink").click(function (){
    var tuesdayhtmls = ("#tuesdayComment");
    var inputt = $("<input type='text' id='tuesdayCommentText' name='tuesdayCommentText' />");
    inputt.val(data.days[1].comment);
    tuesdayhtmls.html("test");
});

$("#wednesdayCommentLink").click(function (){
    var htmls = ("#wednesdayComment");
    var input = $("<input type='text' id='wednesdayCommentText' name='wednesdayCommentText' />");
    input.val(data.days[2].comment);
    htmls.html(input);
});

$("#thursdayCommentLink").click(function (){
    var htmls = ("#thursdayComment");
    var input = $("<input type='text' id='thursdayCommentText' name='thursdayCommentText' />");
    input.val(data.days[3].comment);
    htmls.html(input);
});

$("#fridayCommentLink").click(function (){
    var htmls = ("#fridayComment");
    var input = $("<input type='text' id='fridayCommentText' name='fridayCommentText' />");
    input.val(data.days[4].comment);
    htmls.html(input);
});

$("#saturdayCommentLink").click(function (){
    var htmls = ("#saturdayComment");
    var input = $("<input type='text' id='saturdayCommentText' name='saturdayCommentText' />");
    input.val(data.days[5].comment);
    htmls.html(input);
});

Und von hier heißen sie:

  <th id="mondayComment" name="mondayComment" style="text-align: center; width: 115px;"><div id="mondayCommentLink">+</div></th>
  <th id="tuesdayComment" name="tuesdayComment" style="text-align: center; width: 115px;"><div id="tuesdaysCommentLink">+</div></th>
  <th id="wednesdayComment" name="wednesdayComment" style="text-align: center; width: 115px;"><div id="wednesdayCommentLink">+</div></th>
  <th id="thursdayComment" name="thursdayComment" style="nowrap; text-align: center; width: 115px;"><div id="thursdayCommentLink">+</div></th>
  <th id="fridayComment" name="fridayComment" style="text-align: center; width: 115px;"><div id="fridayCommentLink">+</div></th>
  <th id="saturdayComment" name="saturdayComment" style="text-align: center; width: 115px;"><div  id="saturdayCommentLink">+</div></th> 

Ich verstehe nicht, warum ich einen doppelten Auswahlfehler erhalte#mondayCommentLink, #tuesdayCommentLinkusw. Fehlt mir etwas oder mache ich aus Versehen etwas falsch? Die erste Zelle funktioniert und ich kann darauf klicken und ein Eingabefeld wird angezeigt, aber bei der zweiten Zelle schlägt dies fehl#tuesdayCommentLink an der Linietuesday.htmls.html("test");.

Antworten auf die Frage(3)

Ihre Antwort auf die Frage