How to get the inner text of a DIV using javascript?
P粉809110129
P粉809110129 2023-10-18 11:02:20

How to get the inner text of a DIV controller using java script?

P粉809110129
P粉809110129

reply all(3)
P粉790187507

Short answer:

document.getElementById("id-of-div").innerText

Considering that you've tagged your question with asp.net-mvc-3, the long answer is that it will run in the browser, not on the server (the one running ASP.NET). There is no way to immediately get content from the browser to the server without sending a request. I guess you might want to make an ajax call to the new controller action from the page, but that depends on when the text changes and what you want to do with it.

Popular topics
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!