我正在为一个滴答网站制作一个表格,但无法弄清楚如何默认选择一个按钮。
<form>
<input type="radio" name="gender" value="general"> General<br>
<input type="radio" name="gender" value="medium"> Medium<br>
<input type="radio" name="gender" value="high"> High
</form>
我知道这很简单,但我似乎无法弄清楚
答案 0 :(得分:0)
只需将checked
属性添加到相关输入中即可。
checked属性是布尔属性。
如果存在,则指定在页面加载时应预先选择(选中)元素。
Logger.getLogger("package.class").setLevel(Level.OFF);
答案 1 :(得分:0)
使用import pandas as pd
df = pd.DataFrame({'name':['John','Dave'],
'field1':['blah','blah'],
'field2':['blah','blah']},
index=[1,2],
columns=['name','field1','field2'])
print (df)
name field1 field2
1 John blah blah
2 Dave blah blah
#get today date
today = pd.to_datetime('now').date()
#pandas version 018.0 and more
df = df.rename_axis(today,axis=1)
#pandas verion below 0.18.0
#df.columns.name = today
print (df)
2016-08-11 name field1 field2
1 John blah blah
2 Dave blah blah
#if need remove column name
df = df.rename_axis(None,axis=1)
print (df)
name field1 field2
1 John blah blah
2 Dave blah blah
属性。
checked
答案 2 :(得分:0)
您可以将checked属性添加到输入标记中。
<div class="alert ui-pnotify-container alert-warning ui-pnotify-shadow" style="min-height: 16px;"><div class="ui-pnotify-closer" style="cursor: pointer; visibility: hidden; display: none;"><span class="glyphicon glyphicon-remove" title="Close"></span></div><div class="ui-pnotify-sticker" style="cursor: pointer; visibility: hidden; display: none;"><span class="glyphicon glyphicon-pause" title="Stick"></span></div><div class="ui-pnotify-icon"><span class="glyphicon glyphicon-question-sign"></span></div><h4 class="ui-pnotify-title">Confirmation Needed</h4><div class="ui-pnotify-text">You are currently logged in from another browser.<br>Are you sure to log-off the other session?</div><div style="margin-top:5px;clear:both;text-align:right;"><button type="button" class="btn btn-default ">Ok</button> <button type="button" class="btn btn-default ">Cancel</button></div>
请参阅w3 schools以获取示例。
答案 3 :(得分:0)
在输入中使用“checked”属性进行检查。
<form>
<input type="radio" name="gender" value="general" checked> General<br>
<input type="radio" name="gender" value="medium"> Medium<br>
<input type="radio" name="gender" value="high"> High
</form>
答案 4 :(得分:0)
您可以使用 HTML Checked
标记的input
属性:
<form>
<input type="radio" name="gender" value="general"> General<br>
<input type="radio" name="gender" value="medium"> Medium<br>
<input type="radio" name="gender" value="high" checked> High
</form>