elements

How To Shift Array Elements to right and replace the shifted index with string in Visual C++

VISUAL C++ Question Hi, I have array of 3 elements and I want to shift its elements to the right and replace the shifted index cell with "SHIFTED" string and this should loop until all the cells has "SHIFTED" string. For example: int a[x]={0,1,2}; Initial index and elements Order: [0]=0 [1]=1 [2]=2 should become in the: 1st l...

JQuery input elements

I need to get all input elements within a div and then attach event handlers, so that whenever values change it updates a hidden field. Children elements within the div might already contain event handlers, if so the attach should chain it. Any help is much appreciated. ...

How to tell the browser to cache a specific element in HTML document

I generate output with php. I've been reading about caching HTML elements (e.g. images, text) in the browser so that these don't have to be reloaded. However, I haven't found the right directions on how to get it done. It's like "simply cache the elements you want and you're done!" - great, but how do I cache something like this: <div ...

Getting elements children with certain tag jQuery

I'm trying to get all the input elements from a certain form from jQuery by providing only the name of the form and only knowing that those wanted fields are input elements. Let's say: <form action='#' id='formId'> <input id='name' /> <input id='surname'/> </form> How do I access them individually with jQuery? I tried something like ...

Xpath - How to get all the attribute names and values of an element

I am using xpath in java. I want to get all the attributes (name & Value) of an element. I found the query to get the attribute values of an element, now I want to get attribute names alone or names and values in single query. <Element1 ID="a123" attr1="value1" attr2="value2" attr3="value3" attr4="value4" attr5="value5" /> Here using ...

Wrapping multiple images inside a <div> in jQuery

hello! I need to find all the images inside a div, and wrap a div around them. here's the code I come up with, but that's not working! any ideas? thanks! jQuery(function(){ my_selection = []; $('.post').each(function(i){ if ($(this).find('img').length > 1 ){ my_selection.push(['.post:eq(' + i + ')']); } }); $( my_selectio...

How to make all possible sum combinations from array elements in VB

If there is an array with elements: 1,2,3,4, the program should return another array with sum of all combinations: 1 2 3 4 3 (1+2) 4 (1+3) 5 (1+4) 5 (2+3) 6 (2+4) 7 (3+4) 6 (1+2+3) 7 (1+2+4) 8 (1+3+4) 9 (2+3+4) 10 (1+2+3+4) ...

jQuery Cycle on html elements instead of images?

Is it possible to use the jquery cycle plugin on elements such as a bunch of div tags instead of img tags? ...

Java libarary for HTML elements/tags

Anyone know a decent Java libarary for HTML elements? Ex if I want to create an img-element, I would go new Image(...) The object should support the normal HTML functions/attributes, such as setting CSS or disable. ...

Need a function in javascript to swap 2 elements in an array

A program to swap two numbers /* /* Function to swap two numbers. Function takes an argument which is an array of two elements. Function returns a new array containing the same two elements as the argument array but in reverse ord...

Drawing with element array in OpenGL ES

Hello! I am trying to use OpenGLES to draw a x by y matrix of squares about an arbitrary point. I have an array sideVertice[] that holds a series of vertex structs defined as such typedef struct { GLfloat x; GLfloat y; GLfloat z; } Vertex3D; and an element array defined as such GLubyte elementArray[]; my draw loop is ...

How to get span tag inside a div in jQuery and assign a text?

I use the following , <div id='message' style="display: none;"> <span></span> <a href="#" class="close-notify">X</a> </div> Now i want to find the span inside the div and assign a text to it... function Errormessage(txt) { $("#message").fadeIn("slow"); // find the span inside the div and assign a text $("#message a.clo...

How do you get the width of an element without a defined width?

How would you find out the width of a element that is wrapped by 20 odd other elements, but the only fixed width I know is the main wrapper's which is 800px. All child elements are generally blocks, floating or not, with different paddings and margins. I don't really need the answer to a specific case, I'm just wondering if there are too...

JavaScript accessing form elements using document.forms[].elements[]

var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>'].elements['location_name']; alert(loc_name); This just gives me the message 'undefined' where as... var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>']; alert(loc_name); Gives me the object form business. Have I jus...

jquery fade an element in when a link is clicked and then swap the element when another link is clicked

I have worked out how to fade an element in: Click here to view the page If you click on the heading Posture 1 : Standing Deep Breathing : you will notice the element fades in as it should. If you now click on posture 2 you will see the element fades in below posture 1. I need to be able to swap posture 1 with posture 2. I have a total...

Scheme function to remove first element

write a scheme function that remove the first top level occurrence of a given item from a list of items. eg given list (a b c) item b, result list (a c) plz help me ...

Linq To Xml problems using XElement's method Elements(XName)

Hello everyone. I have a problem using Linq To Xml. A simple code. I have this XML: <?xml version="1.0" encoding="utf-8" ?> <data xmlns="http://www.xxx.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xxx.com/directory file.xsd"> <contact> <name>aaa</name> <email>[email protected]</email> <birt...

Why are my JavaScript variables not persisting across functions?

I have the following JavaScript in my HTML page referencing an HTML form on the page: <script type="text/javascript"> <!-- var myForm = document.myForm; function validateForm() { if (myForm.myInput == "") alert("Please input some text."); return false; } myForm.submit(); } function showFormInput() { ...

Writing XSD schema: if one field contains "A", then other field should not contain "B". How???

A simple scenario: if one field contains "A", then the other field should not contain "B". How to write a XSD schema for it. Example: <root> <field_1>A</field_1> <field_2>B</field_2> </root> How to write an XSD schema that imposes restriction on the value of an element, depending on the value of another element? ...

XML::XML2JSON "0" Element

I'm using XML::XML2JSON in Perl to convert JSON data to XML, I am passing through the following data (snippet): {"question":{"isrequired":{"$t":"0"}}} and when I use the XML:XML2JSON->json2xml function to convert the JSON data into XML, I get the following (snippet): <isrequired/> I need to retain the "0" element in the "isrequired...