I am pulling the text from a select box's options. Now I pass this string value to an append() function, but I want to add a hyphen to the string, for calling an image name:

HTML:

&lt;select&gt;
    &lt;option&gt;Demo Cars&lt;/option&gt;
    &lt;option&gt;New Cars&lt;/option&gt;
    &lt;option&gt;Used Cars&lt;/option&gt;
    &lt;option&gt;Other&lt;/option&gt;
&lt;/select&gt;




var p = 'http://myurl.com/images/';
$('select').eq(0).on('change',function(){
    $('#productQuote').empty();
    var j = $(this).children(':selected').val(); 
    $('#productQuote').append('&lt;img src="'+ p + j + '.jpg' '" /&gt;');
}); 


For example:

If I choose the first select option, the string will be: "Demo Cars", and thus, j == "Demo Cars".

But now I want to call its image, and my image names are not allowed to have spaces inside them. 
So, this begs the question, how do I add a hyphen between Demo and Cars?    


Question: Nexus 4 does not wake up from Sleep randomly
Answer: You might wish to run adb logcat for investigation. But that might only be helpful if you know how to trigger the issue.

Another approach would be, as you already indicated:


start with a factory reset. You know that with a "fresh device" the issue does not happen, as described by your question
install back only a part of your apps (the ones you feel most essential), but not more than ~50%. See if the issue still happens.

Yes: the problematic app was in this batch
No: the problematic app was not in this batch

start over at 1., this time with the other half. Does the issue show up again?


If 2. + 3. are answered "No", it might as well be a combination of apps. If the issue shows up only in either 2. or 3. (but not in both cases), start narrowing down. I will assume here it was part of 3., switch items if it was the other way around:


starting over with factory-reset and installing the first half of your apps.
split the other half in two again, and repeat as above


This procedure should help you finding the culprit, while still being able to use your device and as much of your apps as possible. Of course, you could also start with factory-reset and then install each app one-by-one (which might be the safer approach) – but as the issue might not show up immediately (may even take a day or more), the above might be more practical.