What is '\u00a0' & how can i change this submit button?

	$(f).append($(document.createElement('input')).attr('type','submit').attr('value','\u00a0'));

hello all i have that bit of js in my page.
i need to style the submit button, and am doing it w/css but when i change the size of the button it crowds out everything else.

& this is the full script

	<script type="text/javascript">
		$(document).ready(function(){
			var f = $(document.createElement('form'));
			var s = $(document.createElement('select'));
			$('#country-selector-noscript a').each( function(i,e){
				$(s).append('<option value="'+$(e).attr('href')+'">'+$(e).text()+'</option>');
			});
			$(f).submit(function(e){
				//alert($('div.country-selector select').val());
				document.location = $('div.country-selector select').val()+location.search;
				return false;
			});
			$(f).append(s);
			$(f).append($(document.createElement('input')).attr('type','submit').attr('value','\u00a0'));
			$('div.country-selector').append(f);
		});
	</script>

how can i go about tweaking this so i can style the submit button shape & size?
thx
D

.css({width:‘100px’, height:‘20px’});

The numbers are arbitrary, of course.

HTH,

:slight_smile:

1 Like

i wish.
thx wolfshade, but i tried that. however when id
this is the the css i have

select {
-webkit-appearance: menulist;
box-sizing: border-box;
align-items: center;
border: 1px solid #fff);
border: 1px solid hsla(0,0%, 100%, .5);
border-image-source: initial;
border-image-slice: initial;
border-image-width: initial;
border-image-outset: initial;
border-image-repeat: initial;
white-space: pre;
-webkit-rtl-ordering: logical;
color: #fff;
background:#00aeef;
background: hsla(196,100%, 47%, .3);
cursor: default;
width:300px;
height:50px;
}

input, textarea, keygen, select, button {
margin: 0em;
font: -webkit-small-control;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
height:50px;
}

button {
margin: 0em;
font: -webkit-small-control;
color: #fdb813;
color:rgba(253,184, 19, .8);
color:hsla(42,98%, 53%, .8);
letter-spacing: normal;
display: inline-block;
height:50px;
width:50px;
}


I tried even targeting the button specifically but when i change the width of the button to 50 it will resize also the width of the select element from 300 to 50. So i am missing something here…but not quite sure what to edit.
thx
D

Did you tack my earlier code to the end of the jQuery appended submit?

ok awesome. thank you that worked. i had not understood that i was supposed to append to the script.
how can i keep styling the color etc by using the css stylesheet now.
i could keep appending other css rules but it seems that it would be easier & cleaner to do it trough the css?
Thank you again
D

The select being wiped out must be from something else you coded, because applying that CSS to just the submit button will have ZERO impact on your select… it applies only to the submit.

As usual, and I hate saying this because I’ve been told this many times, myself; no one can really help you without seeing your code.

:slight_smile:

EDIT: I just saw your edit. :smile:
The CSS should be affecting everything else. If you want to specify things specifically for the submit, then use input:submit{}, I think. I’m not well versed in CSS, myself.

Thanks again for the help!
D

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.