jQuery .attr retrieving custom attribute returns undefined

前端 未结 5 1519
北荒
北荒 2021-01-18 00:55

i have the following problem using jquery.

I have sth like this

5条回答
  •  失恋的感觉
    2021-01-18 01:33

    To retrieve the value of elements, use val(). Since divs don't have values, you should use data() to set and get data.

提交回复
热议问题