html

How can I set a css ":hover" on a DOM created element in JavaScript?

I'm using the DOM to manage a JSON response from an AJAX function I'm running. The script I'm writing needs to be completely portable, so I am defining the styles for the created elements on the fly (meaning, no linking to an external CSS, and no providing CSS in the HTML doc itself, because I won't have control of the doc). I'd like to...

Why is my DIV smaller than its contents?

I'm trying to modify the Simple jQuery Slideshow published by Jonathan Raasch. It cycles through all images fading from each to the next. His example works with fixed-size images. I want it to instead work with images sized to a percentage width of the browser window. This works with fixed-size images... #slideshow { ... h...

How to bypass Safari option re-ordering in a select ?

Hello everybody! Im writing a admin panel for a customer's sites, and at few places, i need to put a list of country. He want's to get Canada and US in first place, because his market are mainly US and Canada. So, i write something like that : <select name="customerCoutry"> <option value="US">United States</option> <option ...

Send XML to server for testing

I need to test a program I wrote that receives XML as a text upload from a browser. I'm looking for a tool that will allow me to send the same content over and over instead of having to generate it new each time. I am looking for an Application that can send a text file to a server or a way to do this with JavaScript and HTML The sol...

How do i make a checkbox fire a function ?

I have a checkbox inside a <label> and i want that checkbox, when checked or unchecked, to trigger a function. I attached a onchange trigger to the checkbox but in IE6 the trigger only fires after the focus is turned away from the checkbox, while in FF3 and Chrome it fires right away. I removed the onchange trigger and attached a onclic...

Alternative to radio inputs

I'm trying to make a system which asks users to specify what kind of content they are submitting, using PNG icons to represent each type. Ideally, what I'd like is a group of three buttons (with images on them) which behave like radio buttons - the user can use arrow keys to switch between them, they are treated as one group, etcetera. H...

How do I make an HTML table column squish as tightly as possible? (Or, grow as much as possible?)

I've got a table like this: <table border=1 style="width: 100%"> <tbody> <tr> <td> squish this one </td> <td> expand this one </td> </tr> </tbody> </table> I'd like the left column to be as narrow as possible, and the right column to take up the rest of the screen. Is this possible? ...

how to make a DIV unfocusable?

I met a problem about HTML rendering. In dir="rtl" document of IE7, when JavaScript tries to set focus to a DIV element(with oElement.focus() method), the rendering turns to mess. The context is very complicated, so I suppose the easiest fix is to make the DIV unfocusable? Is there any way to make a DIV not be focused? ...

Conditionally excluding a block of html in ASP.NET WebForms

This is just a simple question: how do I exclude a piece of html on an aspx web form from being returned by the server, based on a server-side evaluation? I'm not talking about a control specifically since they tend to have Visible parameters, but rather just some raw html. ...

CSS Cell Margin

In my HTML document, I have a table with two columns and multiple rows. How can I increase the space in between the first and second column with css? I've tried applying "margin-right: 10px;" to each of the cells on the left hand side, but to no effect. ...

extract title tag from html

I want to extract contents of title tag from html string. I have done some search but so far i am not able to find such code in VB/C# or PHP. Also this should work with both upper and lower case tags e.g. should work with both <title></title> and <TITLE></TITLE>. Thank you. ...

What is a reliable way of doing sidenotes in HTML?

I publish a lot of text online, and even wrote a system to format HTML for me. Now, I have a problem: I want to make sidenotes in HTML pages just like books have. Just to explain, sidenotes are those notes in the margins right next to the main body text. Does anyone know of a good, reliable way to do them -- preferably with plain CSS ra...

How can I convert my button into a hyperlink in PHP?

I need to replace a button on my web page with a hyperlink. I am calling a PHP script using the button. I extract the id using the following statement: $id = $_POST['id']; HTML code: <form id="test1" method="post" action="my.php?action=show"> <input type="hidden" name="id" id="id" value="1" /> <input type="submit" name="submit" ...

resizing the html table width in jquery

I need to vary a table's width after a click event in jQuery. HTML: <table class="zebra" border=0> Case 1: $("table.zebra").css("width","600px"); Case 2: $("table.zebra").css("width","200px"); CSS: table.zebra{} table.zebra tr.even td, table.zebra tr.even th { background-color:#FDD017; } table.zebra tr.odd td { back...

JavaScript and possible browser cache problem

Hello! I am a JavaScript newbie and I am experiencing the following problem: I would write JS code in a separate file, include the file in the html code. JS code runs great. No problems. I would go ahead and make some changes to the JS code, click 'refresh' in the browser window and sometimes there is a problem. The changes I have made ...

How to make a DIV not wrap ?

This requirement sounds wired, but it is actually requirement. I need to create a container DIV style that containing multiple other DIV's. It is asked that these DIV's wouldn't wrap if the browser window is resized to be narrow. I tried to make it work like below. <style> .container { min-width: 3000px; overflow: hi...

Markup suggestions for a layout and some more general questions

Let me explain the basic layout below: |----------------------------| | title banner | | | |----------------------------| | logut-row | |----------------------------| | aN | | <<to be explained>> | | | | ...

How can you make a vote-up-down button like in Stackoverflow?

Problems how to make an Ajax buttons (upward and downward arrows) such that the number can increase or decrease how to save the action af an user to an variable NumberOfVotesOfQuestionID I am not sure whether I should use database or not for the variable. However, I know that there is an easier way too to save the number of votes. H...

Sending values with jQuery's Get function

I am currently coding something to check my database to check for duplicate errors. It is a form and I am having the following function check for duplicate values using jQuery.get. function makeAjaxRequest() { $("label#bad_error").hide(); $("label#good_error").hide(); $("label#checkingdb_error").show(); $.get(url,{sheetnum...

How can I manipulate text through an iframe?

I have two questions. This is core component of a project I'm currently working on. I'm looking for a way to manipulate/edit the source code of an iFrame whose "src" will always be changing: a dynamic iFrame. Is this possible? I know that it's really not recommended because of the potential security issues. And my other question is: ...