I have a successful ajax request that can load all html content, now I only need to get a div tag that contains the identifier "data-today".
How to encode such a script?
Take a look at this SOq:
Something like that:
success: function(data) { //create jquery object from the response html var $response=$(data); //query the jq object for the values var dataToday = $response.find('#data-today').text(); }
$('#data-today').html()if you want all html // this out to put
$('#data-today').html()
if you want the text inside it
$('#data-today').text() // this gives hello how are you
.text () gives text between html
<div> hello how are you </div>
Source: https://habr.com/ru/post/1778894/More articles:How to do a capture by clicking a button in PhoneGap? - javascriptwpf Arabic text not showing correctly - c #xcode dropdown - shows all my class properties and methods. Just want methods - iphoneHow to securely identify a website - fileЕсли вызов веб-службы REST завершается с ошибкой, следует ли повторить попытку отправки сообщения или очереди событий позже? - javaHow can I set the position of the text? - androidIndividual screen of incoming calls - androidЗахват нажатия клавиш в Javascript (Документы Google) - javascriptIpad / Iphone - rotation in UIView with images all - iphoneCocoa menu in the left column - objective-cAll Articles