<form id="form1" name="form1" method="post" action="">
<input type="checkbox" id="check1" value="radio" />
<label>left</label>
<input type="checkbox" id="check2" value="radio2" />
<label>right</label>
</form>
Run Code Online (Sandbox Code Playgroud)
我想知道每次有人点击它时是否检查复选框,然后将变量设置为值yes.
if ($('#check1').attr('checked'); ){
var check1 = 'yes';
else
var check1 ='no'
}
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止,它不起作用我如何返回值
我有以下几个变量:
$texttofind = "story of a test";
$paragraph = "the story of a test and a test paragraph used for
testing the story of a test paragraph";
Run Code Online (Sandbox Code Playgroud)
我想preg_match();用来返回计数,在这种情况下将是2.任何想法?
这是一个简单的例子:
$correction = "game";
$text ="Hello this is an example of a $word that starts with a $dollar sign";
$text = str_replace("\$word",$correct,$text);
Run Code Online (Sandbox Code Playgroud)
如果我回复$ text,它会说:你好,这是一个以美元符号开头的游戏的例子.工作得很好.现在我希望能够将任何以美元符号开头的单词更改为游戏,这样它将改变所有以$开头的单词,并将它们转换为"游戏"这个单词的任何想法吗?
{
code: "AL",
z: 3204
}, {
code: "DZ",
z: 35468
},
Run Code Online (Sandbox Code Playgroud)
试图返回类似的东西.我这样做:
$arr = array ('code'=>array('z'),'US'=>2233332,'c'=>3,'d'=>4,'e'=>5);
echo json_encode($arr);
Run Code Online (Sandbox Code Playgroud) $("table:visible").each(function() {
$(this).find("tr").each(function(){
var row='<tr><td>val</td></tr>';
$(row).insertAfter("#mytable tr:first");
});
});
Run Code Online (Sandbox Code Playgroud)
我想在表格的每一行之后添加一行.我现在使用的是在第一行之后添加一行.例如:
我的桌子有五个.我运行这个js后会有10个.有什么建议吗?