element

jQuery remove tag to custom element

I have the following markup generated dynamically with a split and join function <span> <em style="position: relative;">T</em> <em class="good" style="position: relative;">H</em> <em style="position: relative;">E</em> <em style="position: relative;">S</em> </span> I want to remove the em tag for the elements that do no...

HTML script element localhost uri

Hi, This may seem like a silly question, but consider the following use of the 'script' element to import an external javascript file: <script src="http://localhost:8085/myscript.js" type="text/javascript" > Given that this is a url and not a file path, would this be evaluated server side or client side? If evaluated client side, t...

jQuery: Remove DOM element loaded via ajax

Hi, I'm using jQuery to load ajax content on to a page. However, trying to use jQuery's .remove() function doesn't seem to be working to remove the dynamically loaded element. My example function: function deletePerson(personID){ if (confirm("Are you sure you want to permanently delete this person?\nYou cannot undo this action.")...

jquery apply an attribute to only the first element?

I'm trying to set an a name to the first link with a specific class, but I'm kinda unsure as to how to apply something to just the first one? So, I'm trying to find the first div with the sample class and then wrap the text within the div.title with the : <div class="sample"> <div class="title"><a name="thisone">title</a></div> <p>blah...

mootools inject disabled element

I can't seem to figure out how to inject a disabled element. Any help will be appreciated. I apologize, as I made several mistakes posting this. First of all, i was applying the attribute to an h3 element (how do you disable that??, you don't). Also, I'm afraid I have tried a : with still no effect. Please forgive my error, and here is ...

How to get the innerHtml, including the tag, using jQuery?

Sorry, if the title is too obscure ;D. Actually the problem is, lets say i am this code. <span id="spanIDxx" style="blah-blah"> <tag1>code here </tag2> sample text <tag2>code here </tag2> html aass hhddll sample text </span> Now if i will use the code. jQuery("#spanIDxx").html(); then it will return just the innerHTML e...

jquery: print out hidden element

hi all, i'm using the jQuery Print Element plugin for printing but i think it's a general css issue: how can i print out a hidden element? (with css set to display:none;) when trying, i'm gettin only a plain sheet. is there any solution? thanks ...

How do I create an element on a page which always stays visible but moves out of the way of other elements?

I have a HTML page which a pretty complex layout (see here). I need to put an image on that page which the visitor can drag anywhere so she can remember where she was. I've implemented the bookmark feature but now I need to place the image somewhere where she can easily grab it. Basically, I'd like the element to stay below the ToC on t...

Order number of highlight element

Hello everyone, i need to get number of order highlighted element (by javascript, jquery): <li>A</li> <li>B</li> <li class="highlight">C</li> <li>D</li> so, in this case i want to get number 3 into my variable. Thanks ...

Writing a DTD: How to achieve this children setup

The element tasklist may contain at most one title and at most one description, additionally any number (incl. 0) task elements in any order. The naive approach is not applicable, since the order should not matter: <!ELEMENT tasklist (title?, description?, task*) > Alternatively, I could explicitly name all possible options: (title,...

php - get the first key for an element?

I'm trying to add an extra class tag if an element / value is the first one found in an array. The problem is, I don't really know what the key will be... A minified example of the array Array ( [0] => Array( id => 1 name = Miller ) [1] => Array( id => 4 nam...

jquery scroll function not working on elements wrapping other elements

$(document).ready(function(){ var randomId = "id_"+Math.floor(Math.random()*1000); var wrap1 = $(document.createElement('div')).css('overflow', 'auto') .width(50).height(30).css('border','1px solid black').text('a') .attr('id',randomId); var content1 = $(document.createElement('div')).width(100) .text...

Java: Converting lists of one element type to a list of another type

I'm writing an adapter framework where I need to convert a list of objects from one class to another. I can iterate through the source list to do this as in http://stackoverflow.com/questions/18524/java-best-way-of-converting-listinteger-to-liststring However, I'm wondering if there is a way to do this on the fly when the target list ...

How do i make a "div" button submit the form its sitting in?

I have ASP.Net code generating my button's HTML for me using divs to get it to look and behave how I want. This question is regarding the HTML produced by the ASP.Net code. A standard button is easy, just set the onClick event of the div to change the page location: <div name="mybutton" id="mybutton" class="customButton" onClick="javas...

"img" elements: Block level element or inline element?

I've read somewhere that IMG elements behave like both. If correct, could someone please explain with examples? ...

is there a way to add a variable/property to a DOM element (eg, an element returned by a jQuery selector)

Hi there, I am looking for an alternative to using an object/variable in global scope -- I would like to associate key/value pairs with specific DOM elements (eg, a DIV), so that I can use them as input for logic that processes other elements (eg, child elements of said DIV). I tried something naive like: $('[foo=bar]').key='value' , a...

how to get html element id of smartgwt widgets ?

I want get html id of input field & icon field of a TextItem widget, how can i do this ??? (no getId methos is available for TextItem widget & seems that setAttribiute("id", "foo") has no effect) ...

Hide HTML element by id

Hopefully there's a quick and dirty way to remove the "Ask Question" (or hide it) from a page where I can only add CSS and Javascript: <div class="nav" style="float: right;"> <ul> <li style="margin-right: 0px;" > <a id="nav-ask" href="/questions/ask">Ask Question</a> </li> </ul> </div> ...

fetch HTML Element object using javascript, mootools

Hi, Please check my HTML below: <table cellpadding="0" cellpadding="0" border="0"> <tr> <td> <div class="toogler">Demo1</div> </td> </tr> <tr> <td> <div class="element">Demo1 Content</div> </td> </tr> <tr> <td> <div class="toogler">Demo1</di...

Bind to a property of a parent element in wpf

Hello all, 'I want to bind the Height property of the RichTextBox to the Height Property of the GridView`s Row. How can I do that? I do not know how to get the Row's Height as I can not access the Row in xaml what I would like to do. The Ancestor type should be GridViewHeaderRow , but I do not know its level... EDIT: <my:RadGridView ...