Jquery is used as a project. When the selected item changes in the drop-down list, the compatibility problem of the selected item text in different browsers is obtained. This article will introduce you to using jquery as a project, when the selected item changes in the drop-down list, the text of the selected item is obtained. I wrote it as follows:
The Code is as follows:
$ ("# Rd"). change (function (){
$ ("# Name"). val ($ ("# rd"). find ("option: checked"). text ());
});
Because the browser versions in the development environment are relatively high, IE10, FF23, Chrome29, and test are all correct. If the client has a problem and the text cannot be obtained, it will be discovered after careful testing, the option should be selected. After it is changed to selected, IE6, 7, 7, 8, 10, FF, and chrome are all correct.
It seems that writing code is still careful. The browser of a higher version is compatible with some attributes, which leads to laziness of programmers!