Questions tagged [html-manipulation]
25 questions
59
votes
5 answers
Randomize a sequence of div elements with jQuery
I'm trying to do my frist steps with jQuery but I have some trouble to understand how to find a list of child elements from a div parent element. I'm used to work with ActionScript 2 and ActionScript 3 so i could mistake some concept, like what is…

vitto
- 19,094
- 31
- 91
- 130
45
votes
10 answers
How can I "reset" to its original state after it has been modified by JavaScript?
I have a DIV with a form in it. When users submit the form and it gets successfully submitted, I replace the form with a simple "everything is good now" message:
$("#some_div").html("Yeah all good mate!");
Is there a good way to "reset" the div to…
abolotnov
- 4,282
- 9
- 56
- 88
I have a DIV with a form in it. When users submit the form and it gets successfully submitted, I replace the form with a simple "everything is good now" message:
$("#some_div").html("Yeah all good mate!");
Is there a good way to "reset" the div to…

abolotnov
- 4,282
- 9
- 56
- 88
6
votes
3 answers
Manipulate HTML from php
I'm having an html file, index.php I want to take the content within a
with the class main of that file and replace it with another text. How can i achieve that?
Sample content in html:
Replace this text with some…

esafwan
- 17,311
- 33
- 107
- 166
6
votes
1 answer
Catch-all servlet filter that should capture ALL HTML input content for manipulation, works only intermittently
I need a servlet filter that will capture all input, then mangle that input, inserting a special token in every form. Imagine that the filter is tied to all requests (E.g. url-pattern=*). I have the code for capture of content, but it doesn't seem…

Berlin Brown
- 11,504
- 37
- 135
- 203
6
votes
2 answers
Using htmlagility pack to replace src values
I'm using a CMS system for a website. My content contributors have put some very hefty images in the system and have then gone on to resize them in the cms so they are appropriate for the page or article. When a webuser hits that page, they download…

JK36
- 853
- 2
- 14
- 37
5
votes
4 answers
jQuery: wrap newly created html
I create HTML snippet on-the-fly:
$('').addClass(spanClass)
Is there a jQuery way to wrap this code into
?
Semantically I want to do:
$('').addClass(spanClass).wrap($('').addClass(divClass))
that does not work. So I just…

THX-1138
- 21,316
- 26
- 96
- 160
3
votes
1 answer
Ajax page echo vs background Ajax/direct HTML manipulation?
I have a dilemma, and I could really use some advice.
I am building an ordering system with PHP/Smarty/HTML/jQuery.
Currently working on the site where the seller will confirm orders.
I need to have 3 divs.
Waiting orders div - contains a table…

ZolaKt
- 4,683
- 8
- 43
- 66
3
votes
3 answers
Change div content dynamically with jQuery
I'm wondering how I can change the html content of a div.
This is the starting point:
Output on…
apple
banana
strawberry

Qamelion
- 69
- 1
- 1
- 8
3
votes
2 answers
Compress html output from zend framework 2
I'm currently using Zend Framework 2 beta for on PHP 5.4.4 to develop a personal webapp for self-study purpose.
I was wondering if it is possible to intercept the html output just before it is sent to the browser in order to minify it by removing…

Matteo Tassinari
- 18,121
- 8
- 60
- 81
2
votes
1 answer
Refill form after submit without able to manipulate the code
Normally I'm using a code like this for forms. The PHP code in it is to refill the form, e.g. if something is missing or so:
2
votes
3 answers
Add to Non-tagged HTML Text in PHP
I have this kind of HTML document.
text1
link1
text2
link2
text3
text4
And I'd like to surround text1, text2 and text3 by s.…

Teno
- 2,582
- 4
- 35
- 57
1
vote
4 answers
I need a php regular expression that replaces one tag with another
Here is what I need to be able to do:
I need to match the following tag:
text sample
I need to replace the span with an html3 compliant tag, but keep the text in between. The final tag should look…
Ernie
1
vote
3 answers
Wrap text with until the first
appears
How can I wrap from the beginning of the text in a string until the first
appears? For example, If the string is this is some text
Beginning of a paragraph
I wantthis is some text
Beginning of a…

user2335065
- 2,337
- 3
- 31
- 54
1
vote
1 answer
Rearranging elements with a simple function
function rearrange(x, y) {
x.parentNode.replaceChild(x, y);
x.parentNode.insertBefore(y,x);
}
If I do
var a = document.getElementsByClassName('btn-button-google')[0];
var b =…

EasyBB
- 6,176
- 9
- 47
- 77
1
vote
3 answers
Java to Upper Case Ignoring HTML Special Characters
How do I convert string to upper case String.toUpperCase() ignoring special characters like and all others. The problem is that it becomes   and browser does not recognize them as special HTML characters.
I came up with this but it does…

Vad
- 3,658
- 8
- 46
- 81