87,994
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$().ready(function(){
$('#b').focus(function(event){
$('#b').val($('#a').val().substring(5));
});
});
</script>
</head>
<body>
<input type="text" id="a" value="input abc 1234"/>
<input type="text" id="b" />
</body>
</html>
<body>
<input type="text" id="f" />
<input type="text" id="s" />
<script>
window.onload = function() {
var f = document.getElementById('f'),
s = document.getElementById('s');
s.onfocus = function() {
this.value = f.value.slice(-6);
}
}
</script>
</body>
window.onload = function() {
var b = document.getElementById("b");
b.onfocus = function() {
var a = document.getElementById("a").value;
a = a.substring(a.length - 6 - 1, a.length);
b.value = a;
};
};
window.onload = function() {
var b = document.getElementById("b");
b.focus = function() {
var a = document.getElementById("a").value;
a = a.substring(a.length - 6 - 1, a.length);
b.value = a;
};
};
function pass() {
var b = document.getElementById("password");
b.onfocus = function() {
var a = document.getElementById("no").value;
a = a.slice(4);
b.value = a;