I need to send a div element's inner HTML to server through post request.
What I tired using javascript is, Created a hidden input element and tried to assign the div's inner HTML in it and submitted it to the server. Since the inner HTML has single, double quotes it is not properly assigned to the value of input element.
Kindly suggest best solutions.
You can use urlencode(str)
and urldecode(str)
function or you can refer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.