Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 years ago.
Improve this question
I am trying to put 2 different div's in one row.
I tried creating a new div with display:inline/inline block both, but still they are still displayed in next line.
How can I use CSS o display everything in one row.
<div id ="yourwrapper">
<FORM NAME="myform" ACTION="" METHOD="GET">
Box Name:
<SELECT NAME="list1" ID="list1">
<OPTION>CD1</OPTION>
</SELECT>
<INPUT TYPE="button" NAME="button" VALUE="New" onClick="AddItem1()"/>
<INPUT TYPE="button" NAME="button" VALUE="Delete" onClick="DeleteItem1()"/>
<INPUT TYPE="button" NAME="button" VALUE="Copy" onClick="CopyItem1()"/>
</div>
You can also try
#yourwrapper {
whitespace: no-wrap;
}
which will tell the css not to wrap the elements, and they'll go off the page.
Try this:
#yourwrapper > div{
float:left;
}
Use span rather than divs if you plan to use inline elements. To make elements align to each other use rather float:left (and then clear in the end) or display:inline-block.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 months ago.
Improve this question
Having space between string in Value of a checkbox input like Item Two I am not able to set the checkbox to be checked.
<input type="checkbox" id="item2" name="check" value="Item Two">Item Two
$(":checkbox[value=Item Two]").prop('disabled', true);
Is there any way to fix this without changing the value of the input?
$(":checkbox[value=ItemOne]").prop("checked", "true");
$(":checkbox[value=Item Two]").prop('disabled', true);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="checkbox" id="item1" name="check" value="ItemOne">Item One
<input type="checkbox" id="item2" name="check" value="Item Two">ItemTwo
You must quote the value if it has spaces
$(':checkbox[value="Item Two"]').prop('disabled', true);
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last year.
Improve this question
The error ReferenceError: b is not defined at HTMLButtonElement.onclick (/:32:30)
let s;
function b(){
s = document.getElementById(k).innerHtml;
animates();
}
<form class="form">
<label>How much do you want to donate</label>
<input type="number" id="k">
<button id="l" onclick="b()">Cal</button>
</form>
no need to do a form for this, also inline events are not preferred use eventListeners in js.
NOTE: I've put input's value as result, but you didn't say what you exactly want, so I think this will work with you anyway
document.getElementById('l').addEventListener('click', function() {
document.getElementById('result').innerHTML =document.getElementById('k').value;
})
<label>How much do you want to donate</label>
<input type="number" id="k">
<button id="l">Cal</button>
<p id="result"></p>
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
here is my table:
<ul class="vertical-tabs-list">
<li class="vertical-tab-button first selected">blah</li>
<li class="vertical-tab-button">blah</li>
</ul>
I want to append another li like so:
$(".vertical-tabs-list").append('<li><input type="submit" name="op" id="edit-save" value="Save" class="form-submit"</li>');
What am I doing wrong?
Try this
$("ul.vertical-tabs-list").append('<li><input type="submit" name="op" id="edit-save" value="Save" class="form-submit" /></li>');
This has HTML with no syntax errors and a more specific selector. If that doesn't work check to make sure you have jquery properly linked up with your page.
Also, are you using a document ready function?
$(document).ready(function() {
//your code here
$("ul.vertical-tabs-list").append('<li><input type="submit" name="op" id="edit-save" value="Save" class="form-submit" /></li>');
});
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I want to create a button which allows me to go to a link entered in an input filed.
So this is what I did but it does not work.
<html>
<head>
</head>
<body>
<form action="link">
link : <input type="text" id="link">
<input type="button" value="go" onclick="self.location.href = 'docuement.getElementById('link').value'"/>
</form>
</body>
</html>
What should I do?
Don't use a string literal, get rid of the ' from around the value you assign to self.location.href.
Spell document correctly
You should avoid using self as well, it is an unnecessary level of indirection.
<input type="button" value="go" onclick="location.href = document.getElementById('link').value"/>
Things fixed:
fix spelling of document
unquote the expression to be evaluated
don't bother with self
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Improve this question
I'm trying to set the height of div on my page, because my page content is dynamic. But it don't work.
CSS:
<style type="text/css">
#figmenu {
height: 50px;
}
</style>
JS:
<script type="text/javascript">
function HeightUp() {
var fm = document.getElementById('figmenu');
fm.setAttribute('style', 'height: 500px');
// fm.style.height = '500px';
}
</script>
HTML:
<body>
<div id='cssmenu' onclick=HeightUp();>
<input type="submit" name="change" value="First Button" id="figs"/>
<input type="submit" name="change" value="Second Button" id="tr"/>
<input type="submit" name="change" value="Third Button" id="fbp"/>
</div>
<div id='figmenu'>
<input type="submit" name="change" value="4th Button" id="b4"/>
<input type="submit" name="change" value="5th Button" id="b5"/>
<input type="submit" name="change" value="6th Button" id="b6"/>
</div>
</body>
Your code is working, as you can see in this FIDDLE
When your code execute this line, you will see the background getting bigger:
fm.style.height = '500px';
check whether the page has any other html element contains same id name "figmenu"
in a page there should not be two ids with a same name