Home > Back-end >  Jquery with 3. The text () in the values have a why access to content is empty?
Jquery with 3. The text () in the values have a why access to content is empty?

Time:10-03

 








 
Var TDS=$(this). The parent (). The parent () prevAll ();
Var name=($(TDS [0]). The text ());
Var type=($(TDS) [1]. The text ());
Var price=($(TDS) [2]. The text ());
Alert (price);


$(this) is a label, the name and type can correct values, only price is empty
The name and type the background value is a string type, the price is double, but should be ok with this?

CodePudding user response:

My local test

Instead of


Var TDS=$(" # edit "). The parent (). The parent () prevAll ();
Can the normal

$(this) didn't get to, you check it again,

CodePudding user response:


Personally, I think that the best is to find the tr first and then looking for td, td can add class

Also can add in td id + line number

In order to locate some more accurate

CodePudding user response:

refer to the second floor walk in the four seasons of reply:
personally, I think that the best is to find the tr first and then looking for td, td can add class

Also can add in td id + line number

In order to locate some more accurate





Thank you, give a price that you add a column after the id you can get, but why?

CodePudding user response:

The
reference 1/f, walk in the four seasons of reply:

my local test
Instead of


Var TDS=$(" # edit "). The parent (). The parent () prevAll ();
Can the normal

$(this) didn't get to, you check it again,


Another $(this) is made to, because the name and type is correct, only price didn't get to,

CodePudding user response:

CodePudding user response:

refer to fifth floor walk in the four seasons of reply:


I can't take it like you write, look at layer 3 I reply you, add an id to td,
  • Related