<!DOCTYPE html>
<html>
<head>
<title>Education</title>
<script type="text/javascript">
$(document).ready(function() {
var title = document.title;
console.log(title);
});
</script>
</head>
<body>
<div id="navigationBar" style="">
<div id="sheight" style="">
<div style="height: 13px;"></div>
<div class="menuItem" style="">
<div class="tIcon" style="">
<img src="images/iconeducation.png" />
</div>
<div class="menuText" style="">Education</div>
</div>
<div class="menuItem" style="">
<div class="tIcon" style="">
<img src="images/iconfastcash.png" />
</div>
<div class="menuText" style="">Fast Cash</div>
</div>
</div>
</div>
</body>
如果 .menutext 值等于页面标题,我正在寻找一种方法来设置父 .menuitem 的 id。顶部有一个指向 jsFiddle 的链接。
提前致谢...