小编Has*_*eer的帖子

在更改div内的任何复选框时触发一个函数

假设div中有多个复选框(称之为"startwars")我知道如果通过执行以下操作来改变或点击整个页面上的复选框状态,如何检查并触发函数:

$('input[type=checkbox]').click(function() {
    console.log("somethign is checked on the page")
});
Run Code Online (Sandbox Code Playgroud)

但是,如果我想将该范围限制为div并检查是否有任何复选框状态被更改/单击在div内部,

如果使用JQuery在div元素中更改/单击任何复选框,我想触发一个函数

html javascript css checkbox jquery

7
推荐指数
1
解决办法
5304
查看次数

我的C++代码不起作用

我是C++编程的学生我正在尝试用c ++创建一个年龄计算器,但我坚持将变量与另一个变量相乘这里是代码:

#include <iostream.h>
#include <conio.h>
void main()
{
    clrscr();
    int birthmonth,birthyear,birthdate;
    int currentmonth,currentyear,currentdate;
    int year,month,weeks,cal,calx,days,hours;
    cout<<"Hassan's Age Calculator\n\n";
    cout<<"Enter Your Birth Year(i.e:1996):";
        cin>>birthyear;
    cout<<"\nEnter Your Birth Month(i.e:10):";
        cin>>birthmonth;
    cout<<"\nEnter date of Birth(i.e:27):";
        cin>>birthdate;
    cout<<"\nEnter The Current Month(i.e:7):";
        cin>>currentmonth;
    cout<<"\nEnter The Current Year(i.e:2013):";
        cin>>currentyear;
    cout<<"\nEnter Current Date(i.e:24):";
        cin>>currentdate;
    year=currentyear-birthyear;
    month=year*12;
    weeks=month*4.34;
    cal=(year*365.242)+currentdate;
    calx=cal+30.43;
    days=calx-birthdate;
    hours=days*24;

    cout<<"\n\n\t\tYour Age is "<<year<< " in Years" ;
    cout<<"\n\n\t\tYour Age is "<<month<< " in Months" ;
    cout<<"\n\n\t\tYour Age is "<<weeks<<" in weeks";           
    cout<<"\n\n\t\tYour Age is …
Run Code Online (Sandbox Code Playgroud)

c++ turbo-c++

-1
推荐指数
1
解决办法
443
查看次数

标签 统计

c++ ×1

checkbox ×1

css ×1

html ×1

javascript ×1

jquery ×1

turbo-c++ ×1