I have tried to use javascript to alert the selected textarea value. I am using $("#kandungan_email").html();
to get the whole HTML value include
, but it cannot get
Below is my code:
function hantar_terpilih(){
var content = $("#kandungan_email").html();
alert(content);
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<textarea type="text" rows="9" class="form-control" id="kandungan_email" name="kandungan_email" value="" title="Kandungan Email">Title:TEST Time:12PM Place:Guangzhao Please login to http://google.com for more details Lampiran : http://google.com Thanks.</textarea>
<button type="button" id="updateBtn_5" class="btn btn-sm btn-primary" onclick="hantar_terpilih()">Hantar yang terpilih</button>
The result is shown like below:
Actually, I want the result to be shown like below, just show all HTML value:
Title:TEST Time:12PM Place:Guangzhao Please login to http://google.com for more details Lampiran : http://google.com Thanks.
Hope someone can guide me on how to solve this problem. Thanks.
Note: Don't effect shown in the textarea value.