<!DOCTYPE html>
<html>
<body>
<p>Click the button to create a Text Field.</p>
<button onclick="myFunction()">Try it</button>
<table id="tblCustomListData" border="1" width="100%" style="overflow-x:auto;">
<thead>
<tr class="bgcolorgray">
<th>Sno</th>
<th >Current DR</th>
</tr>
</thead>
</table>
</div >
<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
function myFunction() {
var txtHTML = "";
$('#tblCustomListData tbody').html('');
var x = document.createElement("INPUT");
x.setAttribute("type", "text");
x.setAttribute("id", "uniqueIdentifier");
x.setAttribute("value", "Hello!");
document.body.appendChild(x);
var row = document.createElement("tr");
txtHTML = txtHTML + "<tr>";
txtHTML = txtHTML + "<td>";
txtHTML = txtHTML + document.getElementById("uniqueIdentifier") + "</a>";
txtHTML = txtHTML + "</td>";
txtHTML = txtHTML + "</tr>";
$("#tblCustomListData").append(txtHTML);
}
</script>
</body>
</html>
enter code here
答案 0 :(得分:0)
您忘了添加document.getElementById("uniqueIdentifier").value
到<!DOCTYPE html>
<html>
<body>
<p>Click the button to create a Text Field.</p>
<button onclick="myFunction()">Try it</button>
<table id="tblCustomListData" border="1" width="100%" style="overflow-x:auto;">
<thead>
<tr class="bgcolorgray">
<th>Sno</th>
<th >Current DR</th>
</tr>
</thead>
</table>
</div >
<script type="text/javascript" src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
function myFunction() {
var txtHTML = "";
$('#tblCustomListData tbody').html('');
var x = document.createElement("INPUT");
x.setAttribute("type", "text");
x.setAttribute("id", "uniqueIdentifier");
x.setAttribute("value", "Hello!");
document.body.appendChild(x);
var row = document.createElement("tr");
txtHTML = txtHTML + "<tr>";
txtHTML = txtHTML + "<td>";
txtHTML = txtHTML + document.getElementById("uniqueIdentifier").value + "</a>";
txtHTML = txtHTML + "</td>";
txtHTML = txtHTML + "</tr>";
$("#tblCustomListData").append(txtHTML);
}
</script>
</body>
</html>
p <- tibble(x, y) %>%
table() %>%
CrossTable(prop.r = FALSE, prop.c = FALSE, prop.t = FALSE, prop.chisq = FALSE, fisher = TRUE) %>%
.$fisher.ts %>%
.$p.value
p
[1] 0.7761301