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