我有JS用于创建填充carrierwave文本字段的函数,然后在单击时调用该函数。由于某种原因,我的代码不起作用。我已经四处寻找类似的问题,但没有解决方案。这是我的代码:
HTML:
<div id="quote" class="quote">
<div class="field">
<textarea placeholder="Enter text..." class="textarea" rows="4" cols="70" <%= f.text_area :quote %>
<a id="randomQuote" class="random_quote">Populate Text Area</a>
</div>
</div>
JS:
function populateQuote(){
document.getElementById("#new_tile_quote")[0].value = "TESTING";
}
var quoteButton =document.getElementById('randomQuote');
quoteButton.addEventListener('click', function (){
populateQuote();
});
谢谢!
答案 0 :(得分:1)
transaction quantity
1 50
2 60
3 20
4 40
transaction quantity_bucketed bucket_id overage
1 50 1 0
2 50 1 0
2 10 2 0
3 20 2 0
4 20 2 20