Javascript更改表值

时间:2015-07-18 15:47:18

标签: javascript html5

无法弄清楚为什么我无法更改表值。

function StartGame() {
  document.getElementById("Player1").value = document.getElementById("Name1").value;
  document.getElementById("Player2").value = document.getElementById("Name2").value;
  document.getElementById("Player3").value = document.getElementById("Name3").value;
}

链接到JsFiddle https://jsfiddle.net/steventang166/q1upgdw0/10/

2 个答案:

答案 0 :(得分:1)

game.controller('gameController', ['$rootScope', '$scope', function($rootScope, $scope){ $rootScope.$broadcast('addLogEntry', {message: 'Welcome!'}); .... }]); 没有value属性。它有一个innerHTML:

th

https://jsfiddle.net/q1upgdw0/4/

答案 1 :(得分:0)

foreach( $data as $Adata ){ foreach( $Adata as $arr ){ echo $arr['operatorid']; } } 仅适用于表单控件元素,而不适用于内容流控制元素

变化:

value

要:

document.getElementById("Player1").value = document.getElementById("Name1").value;

DEMO