1
我使用HTML和Javascript製作了一個基本的XML格式化程序。我想添加一個刪除功能。基本上,我希望能夠刪除條目,但不清除或損壞任何其他數據。從大量數據的textarea中刪除某些文本
<contact
<!--John Doe-->
first_name="John"
last_name="Doe"
contact_type="sip"
account_id="104"
subscribe_to="sip:[email protected]"
has_voicemail="1"
can_monitor="1"
>
<numbers>
<number dial="1064" dial_prefix="" label="Extension" />
<number dial="555-0123" dial_prefix="718" label="Work Line" primary="1" />
我在想的辦法是找到包含李四和<contact
刪除到</numbers>
接觸標籤可以`的indexOf()中使用含有某些信息刪除該組。
對於上下文:我向plunkr添加了一個演示。這需要表單數據並將其導出到一個文本
http://run.plnkr.co/plunks/b9QKZ7KZP0IlcyeCTTc9/
什麼*其他數據*不應該受到影響? – VisioN
列表中的其他聯繫人。所以,如果我想刪除John Doe,而不是Jane。 –
我沒有看到 ... – dandavis