CSS – make div’s inherit a height

As already mentioned this can’t be done with floats, they can’t inherit heights, they’re unaware of their siblings so for example the side two floats don’t know the height of the centre content, so they can’t inherit from anything. Usually inherited height has to come from either an element which has an explicit height or … Read more

Does jQuery strip some html elements from a string when using .html()?

After a few quick tests it seems do me that this behavior isn’t caused by jQuery but instead by the browser. As you can easily verify yourself (DEMO http://jsbin.com/ocupa3) var data = “<html><head><title>Untitled Document</title></head><body><p>test</p></body></html>”; data = $(‘<div/>’).html(data); alert(data.html()); yields different results in different browsers Opera 10.10 <HEAD><TITLE>Untitled Document</TITLE></HEAD><P>test</P> FF 3.6 <title>Untitled Document</title><p>test</p> IE6 <P>test</P> so … Read more

Find and replace nth occurrence of [bracketed] expression in string

Here is another possible solution. You can pass the string.replace function a function to determine what the replacement value should be. The function will be passed three arguments. The first argument is the matching text, the second argument is the position within the original string, and the third argument is the original string. The following … Read more

html5 oninvalid doesn’t work after fixed the input field

If you set a value with setCustomValidity() then the field is invalid. That is setting a non-zero length string causes the browser to consider the field invalid. In order to take effects of your new input you have to clear the custom validity. Simply you can use the following: <input required maxlength=”255″ id=”information_name” minlength=1 name=”information[name]” … Read more

Make floating divs the same height

You could try instead of using float, use display: table-cell. You might find some older browsers don’t understand this rule however. See below: #wrapper { display: table; // See FelipeAls comment below width: 300px; } #left { display: table-cell; width: 50px; background: blue; } #right { display: table-cell; width: 250px; background: red; }

Two onClick actions one button

Additional attributes (in this case, the second onClick) will be ignored. So, instead of onclick calling both fbLikeDump(); and WriteCookie();, it will only call fbLikeDump();. To fix, simply define a single onclick attribute and call both functions within it: <input type=”button” value=”Don’t show this again! ” onclick=”fbLikeDump();WriteCookie();” />