我有选择
<select multiple id="select2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Run Code Online (Sandbox Code Playgroud)
还有两个按钮
<input type="button" value="Up" onclick="up()">
<input type="button" value="Down" onclick="down()">
Run Code Online (Sandbox Code Playgroud)
如何使用jquery通过按钮上下移动多选中的选定选项?
我有一个表单中的2个单选按钮用于付款方式 - 我想通过ajax点击加载模板部分.
现在我只能加载信用卡表格 - 我想要做的是如果选择信用卡然后加载信用卡模板如果选择了paypal然后加载paypal模板部分.
表单元素
<input type="radio" class="radio-cc" name="method" value="creditcard"><span class="radio-span">Credit Card</span>
<input type="radio" class="radio-paypal" name="method" value="paypal"><span class="radio-span">Paypal</span>
Run Code Online (Sandbox Code Playgroud)
jQuery的
$("input[name=method]").change(function(){
$.ajax({
type: 'GET',
url: '<?php echo admin_url('admin-ajax.php');?>',
data: {
action: 'CCAjax'
},
success: function(textStatus){
$( '.default-form' ).append( textStatus );
},
error: function(MLHttpRequest, textStatus, errorThrown){
alert(errorThrown);
}
});
});
Run Code Online (Sandbox Code Playgroud)
PHP
function CCAjax()
{
get_template_part('cc');
die();
}
// creating Ajax call for WordPress
add_action('wp_ajax_nopriv_CCAjax', 'CCAjax');
add_action('wp_ajax_CCAjax', 'CCAjax');
Run Code Online (Sandbox Code Playgroud) 我试图瞄准每一行的第一个单词,将颜色更改为只有第一个单词.现在这个正在textarea
后端填充.
<div class="items">
67 small businesses has worked with us since the beginning of time
<br>
<br>3:1 ratio of apple products to humans
<br>
<br>2400 hours clocked in 2012
<br>
<br>13.7 number of times “So what exactly do you do?” is asked weekly
<br>
<br>1628 number of Starbucks K Cups consumed
<br>
<br>32 collective years of creative experience<br></div>
Run Code Online (Sandbox Code Playgroud)
我想要完成的是<span>
在每个第一个单词的前面使用jQuery
或类似的东西:
<div class="items">
<span class="color">67</span> small businesses has worked with us since the beginning of time …
Run Code Online (Sandbox Code Playgroud)