Get value of Span Text

后端 未结 5 1108
萌比男神i
萌比男神i 2020-12-05 01:37

I have a span with class=\"span\" and a hidden field class=\"dropdown\".

The span text changes, and I need to grab the text an

5条回答
  •  一整个雨季
    2020-12-05 02:11

    Judging by your other post: How to Get the inner text of a span in PHP. You're quite new to web programming, and need to learn about the differences between code on the client (JavaScript) and code on the server (PHP).

    As for the correct approach to grabbing the span text from the client I recommend Johns answer.

    These are a good place to get started.

    JavaScript: https://stackoverflow.com/questions/11246/best-resources-to-learn-javascript

    PHP: https://stackoverflow.com/questions/772349/what-is-a-good-online-tutorial-for-php

    Also I recommend using jQuery (Once you've got some JavaScript practice) it will eliminate most of the cross-browser compatability issues that you're going to have. But don't use it as a crutch to learn on, it's good to understand JavaScript too. http://jquery.com/

提交回复
热议问题