OsClassでは、これはfooter.phpからの私のコードです
<div id="footer">
<div class="footer">
<div id="footer_1" class="col">
<h1>location</h1>
<ul>
<form action="<?php echo osc_base_url(true); ?>" method="get" class="search" name="locat">
<input type="hidden" name="page" value="search" />
<input type="hidden" id="sCity" name="sCity" value="" />
<li id="1" onclick="locat();"> mysore</li>
<li id="2" onclick="locat();">bhfgh</li>
</form>
</ul>
</div>
</div>
</div>
JavaScriptは、(同じページに配置されています)
<script type="text/javascript">
function locat()
{
var city = $(this).attr('id');
alert(city);
}
</script>
ここでは、JS機能が動作していません。それは与える
Uncaught TypeError: object is not a function
onclick
問題はどこにありますか?