Perform double click on html element - html

I want to perform double click on an html element. I can click once, but can't double. I tried to move mouse on element, but couldn't find coordinates.
...
IE.Document.GetElementById(An & "q8").focus
IE.Document.GetElementById(An & "q8").dblclick ' not working on hmtl
...
I can't add, change etc. html codes. So I can't add or change events, attributes. I need to doubleclick on element directly, maybe mousemove and click or something like that.
Double click action selects a value from a popup list, and set it to a inputbox. Keystrokes not working. Client side changes are not applied. I tried to change input value, but when another element's value changes first one returns to original value.
(vb6 and ie8+)

Related

Is there a shortcut or extension to preview CSS property values and select one of them in VSCode?

Problem case explained:
I am coding my HTML/CSS and I apply a wrong CSS property value. What I do now is that I have to remove all the line and start typing the property name again to be able to get autocomplete suggestions to choose another value. What I want: be able to place cursor on top of wrong value and run a shortcut that shows me other values to choose from.
This behavior can be seen, for instance, in Android Studio XML properties. When you place the cursor on top of a wrong value you can press Control + Space and choose another value.
Just like you already can place the cursor on top of a color in VSC an get a color picker to choose another color, how can we do this with property values?
Thanks.
I am on Windows and Ctrl + Space works for me.
NOTE: When you have selected the incorrect value (if you have any), make sure that your cursor blinks at the start of the value and not the end of the value. Otherwise, it shows No suggestions box.i.e. to select a value,
Place cursor at the end of the value
Hold Ctrl + Shift + Left Arrow Key to select
Then, hit Ctrl + Space
This will show a list of valid values for the specific property
P.S. VS Code Installed Version: 1.42.1

One label two input fields?

I am working on a form that is in a format like:
HOME CELL
PHONE_NUM TEXT_INPUT TEXT_INPUT2
Why can't TEXT_INPUT and TEXT_INPUT2 be listed in the for with &&?
The benifit of having the label is to keep the input fields aligned correctly on the same row.. is there any other benifit?
Adding a for attribute to a label makes it so clicking on the label will put focus on the input (assuming it's a text input). Therefore having two ids in a single for attribute doesn't make sense: the browser wouldn't know which input to put focus on.
for attributes also have nothing to do with styling and positioning. You should be able to keep your form looking the same without a for attribute.
There ARE other benefits - The <label>provides a usability improvement for mouse users in that when properly bound to the <input> it will toggle the <input>. Basically it gives mouse users a bigger target to hit. Eg they can click the <label> in addition to the <input> or control to give it focus.

How to make a contenteditable div reversible after change made with js?

When I delete some text in the contenteditable div in mistake, I can reverse it with Ctrl + z.
But after I made some change with javascript. I can't use Ctrl + z to reverse to previous change.
For example, when I add node to the selected text ,like <p>or <h1>, I could not reverse the content to previous change.
jsfiddle.net/NfGM3/
(bad coding because I am new to window.getSelection())
I use div instead of textarea because I want to add some node into the content.
So, how can I make it reversible in contenteditable div after change made with js ?
What about adding a keyup event handler that will keep track of the current text after every keyup. You can then trap Ctrl+Z and revert back to the previous content if you detect that Ctrl+Z have been pressed.
You could potentially keep revisions in an array to support a series of Ctrl+Z operations.

JTable: toggle an icon when I double-click a cell

I have a table column that I'm overriding the DefaultCellRenderer to display an icon.
Is there a way I could detect double-clicks on a JTable cell, so I can toggle the corresponding row value's state so that it changes the icon between two values (representing "off" and "on")?
There's two ways:
1) The easier way: Attach a mouse listener to the table, listen for a double click, find the row and column by rowAtPoint/columAtPoint, chenge the value, and call fireCellChanged() in the table model.
2) The harder (but slightly better) way: Have a custom cell editor that upon editing, changes the value, and calls stopCellEditing().
You don't need to do both.
Check this out as well, which does similar but with a button:
http://tips4java.wordpress.com/2009/07/12/table-button-column/
When you perform a single click, the cell rendered is replaced by the cell editor, so provide also a cell editor with same appearance than the rendered, add a mouse listener and capture the double-click and perform any desired action. When you finish invoke stopCellEditing().

Hide arrow in standard dropdown?

Is there a a way to hide the arrow in a standard dropdown select fieldset?
Fiddle link
I have an autocomplete system where you fill in the organisation number of a company and it finds the info based on a database. I'd like to have the select box, but without the arrow..
I need it to do this as it's a double function form, either you can fill in your ORG nr or just manually type it in, pretty simple, probably used all over the internet.
Thanks :)
Kyle,
Usually autocomplete systems use input text elements instead of a select element. This creates what you are trying to achieve. Google is a classic example of this.
If you want, you can take a look at jQuery's autocomplete plugin to get another example and some code ideas, or whatever. http://docs.jquery.com/Plugins/Autocomplete
It's not easy, but you can fake it by putting a button above a Select that has its size property set to a value greater than 0.
Have the Select hidden and positioned absolutely under the button. Clicking the button shows the list. Selecting the list changes the text on the button and re-hides the Select.
This way you need a text box, because you cannot type anything in <select> tag.
And put an onclick event to this box to open autocomplete with all possible values.