Adding content to an input field before sending it
var pegarTxt = document.getElementById("Total").innerText;
//para textarea
document.getElementById('TotalFinaliz').value = pegarTxt;
document.getElementById('TotalFinaliz2').innerText = pegarTxt;
document.getElementById('TotalFinaliz3').innerHTML = pegarTxt;
var pegarTxt = document.querySelector('div').textContent;
document.getElementById('TotalFinaliz4').innerHTML = pegarTxt;
//para input somente .value
document.getElementById('TotalFinaliz5').value = pegarTxt;
<div id="Total">Entou necessitando pegar o conteudo de uma div para minha varivel para que eu possa tratar ela e fazer meu envio de email</div>
<textarea id="TotalFinaliz"></textarea>
<textarea id="TotalFinaliz2"></textarea>
<textarea id="TotalFinaliz3"></textarea>
<textarea id="TotalFinaliz4"></textarea>
<input id="TotalFinaliz5">
var pegarTxt = document.getElementById("Total").innerText;
//no textarea de indice 2
document.getElementsByClassName("RonaldoM")[2].innerText = pegarTxt;
<textarea class="RonaldoM"></textarea>
<textarea class="RonaldoM"></textarea>
<textarea class="RonaldoM"></textarea>
<div id="Total">Entou necessitando pegar o conteudo de uma div para minha varivel para que eu possa tratar ela e fazer meu envio de email</div>
There are many servers that do not allow the file_get_contents() function to be used. For these cases, it is possible to put in a variable some external page using the library Curl
$ch = curl_init();
$timeout = 0;
curl_setopt($ch, CURLOPT_URL, 'http://exemplo.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$conteudo = curl_exec ($ch);
curl_close($ch);
O conteúdo da página estará na variável $conteudo.
file_get_contents
has the purpose of reading files, and by chance also access Urls, whereas the Curl library has for purpose a direct connection to a web page, whether internal to your domain, or even external. So for this reason I believe it is better to use the cUrl
Difference between file_get_contents and Curl
Thank you for the reply, it has been solved
– RonaldoM