I need help in creating a function which I can download the content in a specific DIV element but removed the HTML element inside the Div content. Please help me. Here’s a fiddle for your reference:
In my example I have a Div id=“textareaClone” and inside it, is an html element <span id="target-firstname-2"></span> I want to remove that element but remain the text inside before I download the content.
I am not certain using unwrap. That is just my example to achieve my explanation. Thank you for answering my question. If this is not too much can you give me an example of how can I accomplish your answer? Si I want to download the text inside a Div but remove the element inside it. Thanks
hmm. so what will be the output? I mean will it remove the <span id="target-firstname-2"></span> when I hit on the button and will the text inside the span element retain? I’m experimenting on .text(); now. Thanks.
I have another problem. When I click on the download button it just remove some element but the download function is not working.
I was able to remove the element I am targeting. But how can I bring it together with another function? I have 2 buttons in this example: https://jsfiddle.net/vt34mh6p/
So I want the download file button and remove element button as one function. I want download button to remain. so what will happen is I’m gonna type a text first then I will hit on the download button. Before the selected content will download the file, the remove element function will run first. Any idea?