# "RJS Error: TypeError: $(element) has no properties"

**URL:** <https://www.ruby-forum.com/t/rjs-error-typeerror-element-has-no-properties/100952>\
**Category:** Rails\
**Created:** [August 2, 2006, 2:30am UTC](https://www.ruby-forum.com/t/rjs-error-typeerror-element-has-no-properties/100952 "2006-08-02T02:30:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zecko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/9de053/32.png) [@zecko](https://www.ruby-forum.com/u/zecko)\
**Post date:** [August 2, 2006, 2:30am UTC](https://www.ruby-forum.com/t/rjs-error-typeerror-element-has-no-properties/100952/1 "2006-08-02T02:30:23Z")

</div>

i have lots of divs, which are added via link\_to\_remote. now i want to  
delete them with a link\_to\_remote button for each. i am giving them ids  
with the same name and a serialized number. when trying to access them  
with javascript/rjs, strange things happen: "RJS Error: TypeError:  
$(element) has no propertiesâ?. is this a rails, rjs or prototype bug? or  
am i missing something?

see my code below

# i am rendering forms via partial collection

\<%= render :partial =\> “address/update”, :collection =\>  
@person.addresses %\>

# the partial

[\<%= link\_to\_remote 'x', :url =\> {:controller =\> "address", :action =\> "destroy", :id =\> update.id} %\>]
\<%= form\_remote\_tag( :url =\> { :controller =\> "address", :action =\> "update" }, :html =\>{:name =\> update.id}) %\>
Land
\<%= text\_field "address", "country", "size" =\> 30, :value =\> update.country %\>  
  
\<%= submit\_tag "Aktualisieren" %\> \<%= end\_form\_tag %\>

# the controller

def destroy  
Address.find(params[:id]).destroy  
return if request.xhr? # render RJS instead  
end

# the RJS

page.visual\_effect :fade, ‘addresslist’+params[:id], :duration =\> 1  
page.replace\_html ‘adresslist’+params[:id], ‘’

thanks,  
m.zecko

---

<div class="post-metadata">

**Author:** ![zecko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/9de053/32.png) [@zecko](https://www.ruby-forum.com/u/zecko)\
**Post date:** [August 8, 2008, 12:52am UTC](https://www.ruby-forum.com/t/rjs-error-typeerror-element-has-no-properties/100952/2 "2008-08-08T00:52:53Z")

</div>

Hey,  
I’m having the exact same problem! I’ll let you know if I figure it  
out.  
Bri
