参考:https://stackoverflow.com/questions/17097947/jquery-using-a-variable-as-a-selector
<p id="sample">hello</p>
$("#"+sample).text()
//出力
=> hello
Go to list of users who liked
More than 3 years have passed since last update.
参考:https://stackoverflow.com/questions/17097947/jquery-using-a-variable-as-a-selector
<p id="sample">hello</p>
$("#"+sample).text()
//出力
=> hello
Register as a new user and use Qiita more conveniently
Go to list of users who liked