简体   繁体   English

PHP-获取href / id的值

[英]PHP - get the value of href/id

hello I have a calendar... and I want to put clickable on every days like... 1 2 3 4 5 6... and for example... current date is October 2013... then when I click the number 8.. then I would create like this... 您好,我有一个日历...,我想在每一天都设置可点击状态,例如... 1 2 3 4 5 6 ...例如...当前日期是2013年10月...然后单击数字8 ..然后我将像这样创建...

$clickedDay = 8;
$month = "October";
$year = 2013;

i just need to get the clickedDay... but don't know how to that please help me... 我只需要获取clickedDay ...但不知道该如何处理,请帮助我...

for($i=1; $i<= $day_count; $i++) {
    echo '<a href="" class="cal_day" id="' . $i . '">';
    echo '<div class="day_heading">' . $i . '</div>';
    echo '</a>';
}

this is my code... still don't know cause DIV can't be a clickable so i use <a href> i think 这是我的代码...仍然不知道原因DIV不能被点击,所以我使用<a href>

It's fairly straight forward to make a div clickable: 使div可点击是相当简单的:

HTML
<div class="clickable" id="click_me_div">Click me!</div>

JS
document.getElementById("click_me_div").addEventListener("click", function () {
    alert("you clicked me!");
});

CSS
.clickable:hover { text-decoration: underline; cursor: pointer; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM