# Div replacement

**URL:** <https://www.ruby-forum.com/t/div-replacement/153607>\
**Category:** Rails\
**Created:** [November 19, 2008, 10:58am UTC](https://www.ruby-forum.com/t/div-replacement/153607 "2008-11-19T10:58:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [November 19, 2008, 10:58am UTC](https://www.ruby-forum.com/t/div-replacement/153607/1 "2008-11-19T10:58:35Z")

</div>

Hi,  
Any one please solve the following situation:

```
            On my page i have a search text box and near with i have

```

a link\_to\_function called “Find” with in one div tag.  
below this i have a flash animation on

 tag with id “spot-light”.

what i want to do is once the user type the text and click the “Find”.  
The div tag with id “spot-light” should display the result only not with  
Flash animation.How can achieve this can any one please help me with  
clear description. thanks.

---

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [November 19, 2008, 11:43am UTC](https://www.ruby-forum.com/t/div-replacement/153607/2 "2008-11-19T11:43:41Z")

</div>

Sorry, not sure if that helps you, since you description is a bit  
unclear.  
You have a javascript function “Find” that gets called and then should  
replace  
the content of the div “spot-light”. What’s that to do with the other  
div?

Anyway, that’s some code I used to create a list  
it’s more complex in the original, I pasted just those parts, that  
show how  
to insert a div and set some text):

var row = document.createElement(“div”);  
var col1 = document.createElement(“div”);  
coltext1 = document.createTextNode(fileObj.name);  
col1.appendChild(coltext1);

row.appendChild(col1);  
$(“spot-light”).appendChild(row);

this uses prototype in the last line.
