Ich habe eine Tabelle für die Eingabe von Namen und Details. Ich habe neue Felder von einer Schaltfläche erstellen, aber ich kann niemanden meiner erstellen außer dem ursprünglichen entfernen. Ich versuche, span Klasse Name für Hilfe zu löschen, aber nichts. Bitte helfen Sie mir, es zu lösen. Vielen Dank im Voraus ..Entfernen Sie das erstellte Element durch ID mit Hilfe von jquery
Meine ursprüngliche Datentabelle
<span class="source">
<span id="sprtdiv" class="tab1">
<table width="90%" border="1">
<tr><td><input type="text" class="yuzdeyetmis" name="partname[]" value="" id="pname" placeholder="Name" /><div id="tab1" class="yuzdeotuz"> DELETE </div></td></tr>
<tr><td><textarea rows="3" name="partdetay[]" id="pdetay" placeholder="Detail"></textarea></td></tr>
</table>
</span>
</span>
<input type="button" id="add_more_part" class="upload" value="Add New Record"/>
und ich will Teile neue Daten
$(".yuzdeotuz").click(function(){
var strtab = $(this).attr('id');
alert(strtab);
$("."+strtab).remove();
});
// To add new bolum stream source field dynamically, on click of "Add More Source" button
$('#add_more_part').click(function() {
var tabcount = $('.yuzdeotuz').length;
if (tabcount == 1 || tabcount != 1)
{
tabcount++;
mytab = "tab"+tabcount;
}
$(".source").append('<span id="sprtdiv" class='+mytab+'><table width="90%" border="1"><tr><td><input type="text" class="yuzdeyetmis" name="partname[]" value="" id="pname" placeholder="Name" /><div id='+mytab+' class="yuzdeotuz"> DELETE </div></td></tr><tr><td><textarea rows="3" name="partdetay[]" id="pdetay" placeholder="Detail"></textarea></td></tr></table> </span>');
});
Für meine Arbeits Codes hinzufügen und entfernen https://jsfiddle.net/c71Lmkeh/2/ `
thnks ich brauche diese ... es funktioniert ... – user2175535
@ user2175535 ich es zahlreiche Menge an mal getestet und zeigten keine Fehler. Ja, es funktioniert, aber fühlen Sie sich frei, mich zu informieren, wenn etwas falsch gefunden wird. Anders als das, bitte markieren Sie es als gelöst, wenn es ** genau ** ist, was Sie wollten. – Raymond