网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
当单击段落元素时显示它的文本内容,以下哪句可以实现该功能?()
- A、$("p").on("click",function(){alert($(this).text())})
- B、$("p").on("onclick",function(){alert($(this).text())})
- C、$("p").on("click",function(){alert(this.text())})
- D、以上都不正确
参考答案
更多 “当单击段落元素时显示它的文本内容,以下哪句可以实现该功能?()A、$("p").on("click",function(){alert($(this).text())})B、$("p").on("onclick",function(){alert($(this).text())})C、$("p").on("click",function(){alert(this.text())})D、以上都不正确” 相关考题
考题
单击命令按钮时,下列程序的执行结果为Private Sub Command1_Click()Dim a As Integer, b As Integer, c As Integera=2: b=3: c=4Print P2(c, b, A.End SubPrivate Function P1(x As Integer, y As Integer, z As Integer)P1=2 * x + y + 3 * zEnd FunctionPrivate Function P2(x As Integer, y As Integer, z As Integer)P2=P1(z, x, y) + xEnd Function ( )。A.21B.19C.17D.34
考题
单击一次命令按钮后,下列程序的执行结果是Private Sub Command1_Click()s=P(1) + P(2) + P(3) + P(4)Print sEnd SubPublic Function P(N As Integer)Static SumFor i=1 To NSum=Sum + iNext iP=SumEnd Function( )。A.15B.25C.35D.45
考题
下列程序运行后,单击命令按钮,窗体显示的结果为( )。 Private Function pl(x As Integer,y As Integer,z As Integer) pl=2*x+y+3*z End Function Private Function p2(X As Integer,y As Integer,z As Integer) p2=p1(z,y,x)+x End Function Private Sub Commandl_Click()A.23B.19C.21D.22
考题
(27)窗体上有两个文本框Text1、Text2以及一个命令按钮Commandl,编写下列程序: Dim y As Integer Private Sub Command1_Click() Dim x As Integer x=2 Text1Text=p2(p1(x),y) Text2Text=p1(x) End Sub Private Function pl(x As Integer) As Integer x=x+y:y=x+y pl=x+y End Function Private Function p2(x As Integer,By Val y As Integer) p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为 A.2 4 2 4 B.2 44 8C.4 4 8 8 D.10 1058 58
考题
声明一个对象,给它加上name属性和show方法显示其name值,以下代码中正确 的是( )。
Avarobj = [name:"zhangsan",show:function(){alert(name);}];Bvarobj = {name:"zhangsan",show:”alert()”};Cvarobj = {name:"zhangsan",show:function(){alert(name);}};Dvarobj = {name:"zhangsan",show:function(){alert();}};
考题
单击命令按钮之后,下列程序代码的执行结果为______。 Private Function P(N As Integer) Static sum For I=I To N Sum = sum +1 Next I P =sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S: End SubA.20B.30C.115D.135
考题
以下程序运行后,单击命令按钮,窗体显示的结果是 ______。 Private Function p1(x As Integer,y As Integel,z As Integer) p1=2*x+y+3*z End Function Private Function p2(x As Integer,y As Integer,z As Integer) p2=p1(2,y,x)+x End Function Private SubCommandl_Click() Dim a As Integer Dim b As Integer Dim c As Integer a=2:b=3:c=4 Print p2(c,b,A)End SubA.19B.21C.22D.23
考题
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:DimY As IntegerPrivate Sub Command1 Click( )Dim X As Integerx=2Text1.Text=p2(p1(X),Y)Text2.Text=p1(x)End SubPrivate Function p1(X As Integer)As Integerx+x+v: y=x+yp1=x+yEnd FunctionPrivate Function p2(X As Integer,Y As Integer)As Integerp2=2*x+yEnd Function当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 42 4B.2 44 8C.4 48 8D.10 1058 58
考题
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:Dim y As IntegerPrivate Sub Command1_Click()Dim x As Integerx=2Text1.Text=p2(p1(x),y)Text2.Text=p1(x)End SubPrivate Function p1(x As Integer)As Integerx=x+y:y=x+yp1=x+yEnd FunctionPrivate Function p2(x As Integer,y As Integer)As Integerp2=2*x+yEnd Function当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 4 2 4B.2 4 4 8C.4 4 8 8D.10 10 58 58
考题
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序: Dim y As IntegerPrivate Sub Command1_Click()Dim x As Integer x=2 Text1.Text=p2(p1(x), y) Text2.Text=pi(x)End SubPrivate Function p1(x As Integer) As Integer x=x+y:y=x+y p1=x+yEnd FunctionPrivate Function p2(x As Integer, y As Integer) As Integer p2=2*x+yEnd Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 4 2 4B.2 4 4 8C.4 4 8 8D.10 10 58 58
考题
窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。设有如下的类型声明: Type Person name As String*8 major As String*20 End Type 当单击“Command1”按钮时,能够正确地把数据写入文件的程序段是______。A.Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open"C:\data. dat" For Random As #1 Put #1, 1, p Close #1 End SubB.Private Sub Command1_Click() Dim p As Person p. name=Text1.Text p. major=Text2. Text Open"C:\data. dat" For Random As #1 Get #1, 1, p Close #1 End SubC.Private Sub Command1_Click() Dis p As Person p. name=Text1. Text p. major=Text2. Text open "C:\data. dat" For Random As #1 Len=Len(p) Put #1, 1, p Close #1 End SubD.Private Sub Command1_Click() Dim p As Person p. name=Text1. Text p. major=Text2. Text Open "C:\data. dat" For Random As #1=Len(p) Get #1, 1, p Close #1 End Sub
考题
窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序: DimY As Integer Private Sub Command1 Click( ) Dim X As Integer x=2 Text1.Text=p2(p1(X),Y) Text2.Text=p1(x) End Sub Private Function p1(X As Integer)As Integer x+x+v: y=x+y p1=x+y End Function Private Function p2(X As Integer,Y As Integer)As Integer p2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。A.2 4 2 4B.2 4 4 8C.4 4 8 8D.10 10 58 58
考题
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序Dim y As IntegerPrivate Sub Command1_Click()Dim x As Integerx=2Text1.Text=Fun2(Funl(x),y)Text2.Text=Funl(x)End SubPrivate Function Funl(x As Integer) As Integerx=x+y ∶y=x+yFunl=x+yEnd FunctionPrivate Function Fun2(x As Integer,y As Integer) As IntegerFun2=2*x+yEnd Function当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别是A.2 4 2 4B.2 4 4 8C.10 10 58 58D.4 4 8 8
考题
下列程序的执行结果是( )。 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S; End SubA.15B.16C.2OD.25
考题
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序 Dim y As Integer Private Sub Command1_Click() Dim x As Integer X=2 Text1.Text=Fun2(Fun1(x),y) Text2.Text=Fun1(x) End Sub Private Function Fun1(x As Integer)As Integer x=x+y:y=x+y Fun1=x+y End Function Private Function Fun2(x As Integer,y As Integer)As Integer Fun2=2*x+y End Function 当单击1次和单击2次命令按钮后,文本框Textl和Text2内的值分别是A.2 4 2 4B.2 4 4 8C.10 10 58 58D.4 4 8 8
考题
以下哪段代码不能正确创建函数show()?()A、function show(text){ alert(text); }B、var showFun = function show(text){ alert(text); }C、var showFun = function(text){ alert(text); }D、var showFun =new function("text" , "alert(text)"};
考题
预测以下代码片段的输出结果:() function add(i) { var k = i+10; alert(k); } ; function add(i) { var k = i+20; alert(k); } ; add(10);A、40B、20C、30D、程序出错
考题
要求用JavaScript实现下面的功能:在一个文本框中内容发生改变后,单击页面的其他部分将弹出一个消息框显示文本框中的内容,下面语句正确的是()。A、〈input type="text" onClick="alert(this.value)"〉B、〈input type="text" onChange="alert(this.value)"〉C、〈input type="text" onChange="alert(text.value)"〉D、〈input type="text" onClick="alert(value)"〉
考题
以下关于jQuery点击事件正确的是()。A、$(’button’).onclick()B、$(’button’).onclick(function(){})C、$(’button’).on(’click’,function(){})D、$("button").click(function(){})
考题
对下列代码分析正确的是() function msg() { var p=document.createElement(“p”); var Text=document.createTextNode(“Hello!”); p.appendChild(“Text”); document.body.appendChild(p); }A、代码第2行是创建一个P元素标签B、代码第3行是创建一个文本节点C、P是文本节点的子节点D、这代码的作用是创建新的节点
考题
多选题以下关于jQuery点击事件正确的是()。A$(’button’).onclick()B$(’button’).onclick(function(){})C$(’button’).on(’click’,function(){})D$(button).click(function(){})
考题
单选题预测以下代码片段的输出结果:() function add(i) { var k = i+10; alert(k); } ; function add(i) { var k = i+20; alert(k); } ; add(10);A
40B
20C
30D
程序出错
考题
单选题当单击段落元素时显示它的文本内容,以下哪句可以实现该功能?()A
$(p).on(click,function(){alert($(this).text())})B
$(p).on(onclick,function(){alert($(this).text())})C
$(p).on(click,function(){alert(this.text())})D
以上都不正确
考题
单选题以下哪段代码不能正确创建函数show()?()A
function show(text){ alert(text); }B
var showFun = function show(text){ alert(text); }C
var showFun = function(text){ alert(text); }D
var showFun =new function(text , alert(text)};
考题
单选题要求用JavaScript实现下面的功能:在一个文本框中内容发生改变后,单击页面的其他部分将弹出一个消息框显示文本框中的内容,下面语句正确的是()。A
〈input type=text onClick=alert(this.value)〉B
〈input type=text onChange=alert(this.value)〉C
〈input type=text onChange=alert(text.value)〉D
〈input type=text onClick=alert(value)〉
考题
( 难度:中等)下列定义名为fun 的函数语法正确的是:A. functionfun(a){alert(a);}B. varfun=function(a){alert(a);}C. varfun=newFunction(“a”,”alert(a);”);D. varfun=Function(“functionfun(a){alert(a);}”);
考题
( 难度:中等)下列哪种是正定义javascript 方法的正确方式A.var funName = function(){}B.function funName (){}C.var funName = new function(){}D.var funName = new Function("x,y",".alert(x+y)");
热门标签
最新试卷