jQWidgets Forums
jQuery UI Widgets › Forums › Getting Started › Why elements are not at the same level?
This topic contains 2 replies, has 2 voices, and was last updated by digikv 6 years, 4 months ago.
-
Author
-
Why input tag and combo div are not at the same level?
<!DOCTYPE html>
<html lang=”en”>
<head>
<title>jQuery ComboBox</title>
<link rel=”stylesheet” href=”../../jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”../../scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxlistbox.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcombobox.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxinput.js”></script>
</head>
<body>
<div id=’content’>
<script type=”text/javascript”>
$(document).ready(function () {
var source = [
“Affogato”,
“Americano”,
“Bicerin”,
“Breve”,
“Café Bombón”,
“Café au lait”,
“Caffé Corretto”,
“Café Crema”,
“Caffé Latte”,
];
// Create a jqxComboBox$(“#result”).jqxInput({ width: ‘100px’, height: ’25px’});
$(“#jqxcombobox”).jqxComboBox({ source: source, selectedIndex: 0, width: ‘200px’, height: ’25px’ });
// disable the sixth item.
$(“#jqxcombobox”).jqxComboBox(‘disableAt’, 5);
// bind to ‘select’ event.
$(‘#jqxcombobox’).bind(‘select’, function (event) {
var args = event.args;
var item = $(‘#jqxcombobox’).jqxComboBox(‘getItem’, args.index);
$(“#result”).val(item.label);
});
});
</script>
<input id=”result” disabled=”” value=”Result”>
<div style=”display: inline-block;” id=’jqxcombobox’>
</div>
</div>
</body>
</html>Dear Customer,
ComboBox is a Block-Element, Input is Inline element. That is the reason. You can put them in a DIV tag with FLEX or GRID layout if you wish to make them on the same level. If you use a browser which does not support FLEX and GRID layouts, use the TABLE tag with TR and TD elements.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.comOK. All right.
-
AuthorPosts
You must be logged in to reply to this topic.