单击编辑链接后,我尝试使用 JQUERY 从 HTML 下方获取td值,并将其分成 3 个单独的变量,如下所示
company=Microsoft Technologies
Period = 2011/3 - Current
designation = Software Engineer
<table summary="My Company" id="mylistbl">
<thead>
<tr>
<th scope="col">Company</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
<tr object_type="999920113" object_id="872733">
<td width="290">Microsoft Technologies<br><span style="font-size:11px; color:#555;">Period : 2011/3 - Current <br>Designation : Software Engineer</span>
</td>
<td><a href="#" title="Delete">Delete</a>/<a href="#" title="Edit">Edit</a>
</td>
</tr>
</tbody>
</table>
$('body').on('click','a[title="Edit"]',
function(){
parObj=$(this).parent().parent();
alert(parObj.children()[0].html);
return false;
});
我认为在parObj.children()[0].html的某个地方我做错了得到所需的文本
这是 JSFiddle